Update Jenkinsfile

This commit is contained in:
Nana Janashia
2021-01-04 11:56:48 +00:00
parent ae5ce790f4
commit 9904bca4f8

16
Jenkinsfile vendored
View File

@@ -51,5 +51,21 @@ pipeline {
} }
} }
} }
stage('commit version update') {
steps {
script {
withCredentials([usernamePassword(credentialsId: 'gitlab-credentials', passwordVariable: 'PASS', usernameVariable: 'USER')]) {
// git config here for the first time run
sh 'git config --global user.email "jenkins@example.com"'
sh 'git config --global user.name "jenkins"'
sh "git remote set-url origin https://${USER}:${PASS}@gitlab.com/nanuchi/java-maven-app.git"
sh 'git add .'
sh 'git commit -m "ci: version bump"'
sh 'git push origin HEAD:jenkins-jobs'
}
}
}
}
} }
} }