简体   繁体   中英

Shell command not working from jenkins pipeline

Below doesn't work. Please let me know what the issue is.

sh label: 'Salesforce Validation on ' + salesforceEnvironment,
script: 'sfdx force:source:deploy --verbose' + checkOnlyParam + ' --wait 1440 --manifest manifest/package.xml --targetusername ' + salesforceEnvironment > SalesForceValidation.log

Use ${...} for string interpolation inside a GString :

sh  label: "Salesforce Validation on ${salesforceEnvironment}",
    script: """
        sfdx force:source:deploy
        --verbose ${checkOnlyParam}
        --wait 1440
        --manifest manifest/package.xml
        --targetusername ${salesforceEnvironment} > SalesForceValidation.log
        """

Below worked

tee('SalesForceValidation.log') { sh label: 'Salesforce Validation on ' + salesforceEnvironment, script: 'sfdx force:source:deploy --verbose' + checkOnlyParam + ' --wait 1440 --manifest manifest/package.xml --targetusername ' + salesforceEnvironment }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM