Skip to content

Commit a48bdc4

Browse files
author
Olivier Revial
authored
Add clearer credentialsId to examples
1 parent 0826fdf commit a48bdc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pipeline-examples/push-git-repo/pushGitRepo.Groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
// credentialsId here is the credentials you have set up in Jenkins for pushing
77
// to that repository using username and password.
8-
withCredentials([usernamePassword(credentialsId: 'MyID', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
8+
withCredentials([usernamePassword(credentialsId: 'git-pass-credentials-ID', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
99
sh("git tag -a some_tag -m 'Jenkins'")
1010
sh('git push https://${GIT_USERNAME}:${GIT_PASSWORD}@<REPO> --tags')
1111
}
1212

1313
// For SSH private key authentication, try the sshagent step from the SSH Agent plugin.
14-
sshagent (credentials: ['git-credentials']) {
14+
sshagent (credentials: ['git-ssh-credentials-ID']) {
1515
sh("git tag -a some_tag -m 'Jenkins'")
1616
sh('git push <REPO> --tags')
1717
}

0 commit comments

Comments
 (0)