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