0
votes

In Below command I want to skip cmdParamString argument since that is not required for one of apps deployment , and its required for other apps deployment so cant change this common deploy command , how can I implement that?

def deployCommand = "\"${msDeploy}\\MSDeploy.exe\" -verb:sync -source:package=\"${packageLocation}\" -dest:${destParamsString} ${cmdParamString}" 

Output C:\bin\jenkins\workspace\Deploy Test>"C:\Program Files\IIS\Microsoft Web Deploy V3\MSDeploy.exe" -verb:sync -source:package="C:/bin/jenkins/ArtifactorySharedDownloads/cabb6d400bb5f176700c6bb21f0a5a6580c6c97f/package.zip" -dest:ContentPath="C:\WWW\Service",ComputerName="http:local.test/MSDeployAgentService",Username="xyz",Password="abc" -setParam:"NLog Database connection string"="server=No DB setting,null;database=null;Integrated Security=SSPI" -setParam:"NLog Log Level"="null" -setParam:"ISL Database connection string"="server=No DB setting,null;database=null;Integrated Security=SSPI"

15:46:00 Error: Unrecognized argument 'NLog Database connection string'.

I tried

if(application.name == "abc") {
    cmdParamString = '--%'              
}

Error: Unrecognized argument '--'.

1
How is deplyCommand ran? - cfrick
@cfrick bat(deployCommand) is being called, also deploy.proj file is used in which I have defined these projects - Nisha Sakshi
So this is a jenkins question? - cfrick
yes groovy file is having deploycommand and delpoy.proj is having Target projects and its paramters - Nisha Sakshi
@cfrick since these are all null, -setParam:"NLog Database connection string"="server=No DB setting,null;database=null;Integrated Security=SSPI" -setParam:"NLog Log Level"="null" -setParam:"ISL Database connection string"="server=No DB setting,null;database=null;Integrated Security=SSPI" deploycommand keeps failing - Nisha Sakshi

1 Answers

0
votes

solution to this is passing an empty argument like below and it worked:

def cmdParamString = [ all database connection details are filled here]

if (application == 'abc') {
  cmdParamString = [:]
}

this has ignored cmdParamString in deployCOmmand for application abc