Skip to content

Commit 9461a91

Browse files
Use credentials when creating .npmrc
1 parent c22a1fc commit 9461a91

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Jenkinsfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,17 @@ pipeline {
197197
}
198198
}
199199
steps('Install Zowe CLI') {
200-
timeout(time: 10, unit: 'MINUTES') {
201-
echo "Install Zowe CLI globaly"
202-
sh "rm -f ~/.npmrc"
203-
sh 'curl -u $USERNAME:$API_KEY https://eu.artifactory.swg-devops.com/artifactory/api/npm/auth/ >> ~/.npmrc'
204-
sh "echo registry=$TEST_NPM_REGISTRY >> ~/.npmrc"
205-
sh "echo @brightside:registry=$TEST_NPM_REGISTRY >> ~/.npmrc"
206-
sh "echo @zowe:registry=$TEST_NPM_REGISTRY >> ~/.npmrc"
207-
sh("npm install -g @zowe/cli@cicsdev")
208-
sh("zowe --version")
200+
withCredentials([usernamePassword(credentialsId: ARTIFACTORY_CREDENTIALS_ID, usernameVariable: 'USERNAME', passwordVariable: 'API_KEY')]) {
201+
timeout(time: 10, unit: 'MINUTES') {
202+
echo "Install Zowe CLI globaly"
203+
sh "rm -f ~/.npmrc"
204+
sh 'curl -u $USERNAME:$API_KEY https://eu.artifactory.swg-devops.com/artifactory/api/npm/auth/ >> ~/.npmrc'
205+
sh "echo registry=$TEST_NPM_REGISTRY >> ~/.npmrc"
206+
sh "echo @brightside:registry=$TEST_NPM_REGISTRY >> ~/.npmrc"
207+
sh "echo @zowe:registry=$TEST_NPM_REGISTRY >> ~/.npmrc"
208+
sh("npm install -g @zowe/cli@cicsdev")
209+
sh("zowe --version")
210+
}
209211
}
210212
}
211213
}

0 commit comments

Comments
 (0)