Skip to content

Instantly share code, notes, and snippets.

@antrew
Created January 31, 2017 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save antrew/e9760745948d449e0df549878f3bc1f0 to your computer and use it in GitHub Desktop.
Save antrew/e9760745948d449e0df549878f3bc1f0 to your computer and use it in GitHub Desktop.
#!groovy
def handleCheckout = {
checkout ([
$class: 'GitSCM',
branches: scm.branches,
extensions: [
[$class: 'PruneStaleBranch'],
[$class: 'CleanCheckout']
],
userRemoteConfigs: scm.userRemoteConfigs
])
}
node() {
stage('setup') {
sh "env | sort"
handleCheckout()
sh "git branch -vv"
}
stage('test') {
sh "echo 'Throw in some tests here'"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment