Skip to content

Instantly share code, notes, and snippets.

@plavjanik
Last active April 8, 2022 04:42
Show Gist options
  • Select an option

  • Save plavjanik/350592f1fd141d2bdc18dbae8b58c183 to your computer and use it in GitHub Desktop.

Select an option

Save plavjanik/350592f1fd141d2bdc18dbae8b58c183 to your computer and use it in GitHub Desktop.
Using Zowe CLI Docker image in Jenkins
stage('Use the Zowe CLI Image in Jenkins') {
agent {
docker {
image 'zowe-cli:latest'
label 'docker' // Use a label that is used by Jenkins agents with Docker
args '--cap-add ipc_lock' // This capability is needed for the Secure Credential Store
registryUrl 'https://docker.artifactory.acme.net/'
registryCredentialsId 'artifactoryCredentials'
}
}
steps {
sh 'zowe --version'
// Set the credentials for the base profile:
withCredentials([usernamePassword(credentialsId: 'mainframeCredentials', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) {
sh 'zowe config set profiles.base.properties.user "$USER"'
sh 'zowe config set profiles.base.properties.password "$PASSWORD"'
// You can set more variables here
}
// Commands that need credentials:
sh 'zowe zosmf check status'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment