Skip to content

Instantly share code, notes, and snippets.

@yarinkos
Created July 5, 2018 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yarinkos/c106526e4bd35d412e05018fc39cbbc3 to your computer and use it in GitHub Desktop.
Save yarinkos/c106526e4bd35d412e05018fc39cbbc3 to your computer and use it in GitHub Desktop.
Simple git clone commit ,update version and push
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