Created
July 5, 2018 09:29
-
-
Save yarinkos/c106526e4bd35d412e05018fc39cbbc3 to your computer and use it in GitHub Desktop.
Simple git clone commit ,update version and push
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent { | |
node { | |
label 'label' | |
} | |
} | |
stages { | |
stage('checkout git') { | |
steps { | |
git credentialsId: 'ae31c482-72fc-****-8c81-662daa51f408', url: 'https://github.com/****/complicated_hello_world.git' | |
} | |
} | |
stage('git push') { | |
steps { | |
sh 'git checkout -b tmp' | |
sh 'touch foo' | |
sh 'git add foo' | |
sh 'git commit -m "upgrade pom version"' | |
withCredentials([usernamePassword(credentialsId: 'ae31c482-72fc-4075-8c81-662daa51f408', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) { | |
sh("git tag -a some_tag4 -m 'Jenkins'") | |
sh('git push https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/******/complicated_hello_world.git --tags') | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment