Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
Use gitUsernamePassword in Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
amues committed Mar 23, 2023
1 parent 8c5149b commit 5a4f6ef
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,15 @@ builders = pipeline_builder.createBuilders { container ->

// Push any changes resulting from formatting
withCredentials([
usernamePassword(
credentialsId: 'cow-bot-username-with-token',
usernameVariable: 'USERNAME',
passwordVariable: 'PASSWORD'
gitUsernamePassword(
credentialsId: 'dmsc-gitlab-username-with-token',
gitToolName: 'Default'
)
]) {
withEnv(["PROJECT=${pipeline_builder.project}"]) {
container.sh """
cd ${pipeline_builder.project}
git push https://$USERNAME:$PASSWORD@github.com/ess-dmsc/${pipeline_builder.project}.git HEAD:$CHANGE_BRANCH
git push https://github.com/ess-dmsc/${pipeline_builder.project}.git HEAD:$CHANGE_BRANCH
"""
} // withEnv
} // withCredentials
Expand Down

0 comments on commit 5a4f6ef

Please sign in to comment.