Skip to content

Instantly share code, notes, and snippets.

@evagonz
Created June 12, 2018 12:31
Show Gist options
  • Save evagonz/e9078b336cae20ae37e2f79dbb22712e to your computer and use it in GitHub Desktop.
Save evagonz/e9078b336cae20ae37e2f79dbb22712e to your computer and use it in GitHub Desktop.
stage('get code') {
node('jenkins-worker') {
// just by specifying your git credentials and repo, the pipeline knows to check it out and run the next steps from that repo
git credentialsId: '$key', url: 'git@github.com:$usr/$repo.git', branch: "${env.BRANCH_NAME}"
// this is a script in the root of the $repo.git repository
sh './run-me.sh'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment