0
votes

Can Jenkins Slave have its own Credential which can be read by pipeline steps for the jobs running on the slave node? If yes, how to set it up?

My pipeline step need to connect with Salesforce sandbox and the credentials can't be added to Jenkins Master (as the Jenkins group is a multi tenant setup and don't allow custom project specific credentials to be added).

stage ('Validate') {
            withCredentials([
                usernamePassword(credentialsId: params.SANDBOX, passwordVariable: 'sfPassword', usernameVariable: 'sfUsername')
            ]) {
               // use salesforce ant libraries to validate the code 
               // in a sandbox using the above credentials
 }
1

1 Answers

0
votes

Can you create some global variables with for user & PW. You can encrypt the PW variable if you need to