Hello everybody,
I am trying to set $parameters for my auto-deployment job of Jenkins to execute the powershell script via jenkins from a application server on a external database server.
I already installed the powershell plugin and have created a script that is working so far (without all necassary parameters)
When entering the following script in powershell on the external application server the job is working.
#############################################################################
$Username = ‘AMUSERNAME’
$Password = ‘ADMPASSWORD’
$pass = ConvertTo-SecureString -AsPlainText $Password -Force
$Cred = New-Object System.Management.Automation.PSCredential -ArgumentList $Username,$pass
Invoke-Sqlcmd -Query “DECLARE @ProjectBinary AS varbinary(max)
DECLARE @operation_id AS bigint SET @ProjectBinary = (SELECT * FROM OPENROWSET(BULK ‘\deployfrom-database\C$\Jenkins_workspace\SSIS#### DB-New1234\Bin\Development#### DB-New1234.ispac’, SINGLE_BLOB) AS BinaryData)
USE SSISDB
EXEC catalog.deploy_project @folder_name = ‘foldername_of_project’, @project_name = ‘#### DB-New1234’, @Project_Stream = @ProjectBinary, @operation_id = @operation_id out
;” -ServerInstance “deployto-database”
################################################################################
Now I want to set the “right parameters”, so that I can copy the script into Jenkins for each project.
The following parameter is working so far.
$DestinationServer = ‘deployto-database’
The new working script looks like:
############################################################################
$Username = ‘AMUSERNAME’
$Password = ‘ADMPASSWORD’
$pass = ConvertTo-SecureString -AsPlainText $Password -Force
$Cred = New-Object System.Management.Automation.PSCredential -ArgumentList $Username,$pass
$DestinationServer = ‘deployto-database’
Invoke-Sqlcmd -Query “DECLARE @ProjectBinary AS varbinary(max)
DECLARE @operation_id AS bigint SET @ProjectBinary = (SELECT * FROM OPENROWSET(BULK ‘\deployfrom-database\C$\Jenkins_workspace\SSIS#### DB-New1234\Bin\Development#### DB-New1234.ispac’, SINGLE_BLOB) AS BinaryData)
USE SSISDB
EXEC catalog.deploy_project @folder_name = ‘foldername_of_project’, @project_name = ‘#### DB-New1234’, @Project_Stream = @ProjectBinary, @operation_id = @operation_id out
;” -ServerInstance $DestinationServer
#################################################################
Furthermore in the configuration of the jenkins Jobs I have to set parameters for:
$DestinationPath = ‘/SSISDB/foldername_of_project’
With this parameter I don´t know how to implement in my script.
I have tried several things but I don´t get it to work.
Anyone has an idea how to set the right parameters in the script &/ Jenkins?
Grateful for every kind of help!
Looking forward to hearing from you,
Best regards
Manfred