Last active
April 8, 2022 04:42
-
-
Save plavjanik/350592f1fd141d2bdc18dbae8b58c183 to your computer and use it in GitHub Desktop.
Using Zowe CLI Docker image in Jenkins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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