diff --git a/Jenkinsfile b/Jenkinsfile index cb1be88..8218bcb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,7 +43,25 @@ pipeline { steps { script { echo 'deploying docker image to EC2...' - echo 'bla' + } + } + } + stage('commit version update') { + steps { + script { + withCredentials([usernamePassword(credentialsId: 'gitlab-credentials', passwordVariable: 'PASS', usernameVariable: 'USER')]) { + sh 'git config --global user.email "jenkins@example.com"' + sh 'git config --global user.name "jenkins"' + + sh 'git status' + sh 'git branch' + sh 'git config --list' + + 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' + } } } }