Jenkins login fix
This commit is contained in:
10
Jenkinsfile
vendored
10
Jenkinsfile
vendored
@@ -25,13 +25,17 @@ pipeline {
|
||||
}
|
||||
stage('Commit & Push') {
|
||||
steps {
|
||||
script {
|
||||
withCredentials([usernamePassword(
|
||||
credentialsId: env.GIT_CREDENTIALS,
|
||||
usernameVariable: 'GIT_USER',
|
||||
passwordVariable: 'GIT_PASS'
|
||||
)]) {
|
||||
sh '''
|
||||
git config user.name "jenkins"
|
||||
git config user.email "jenkins@example.com"
|
||||
git add test.txt
|
||||
git commit -m "Update test.txt from Jenkins"
|
||||
git push origin main
|
||||
git commit -m "Update test.txt from Jenkins" || echo "No changes to commit"
|
||||
git push https://$GIT_USER:$GIT_PASS@git.karel.one/karel/test.git main
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user