Guest User

Untitled

a guest
May 20th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. isPR = env.BRANCH_NAME ? env.BRANCH_NAME.startsWith("PR-") : false
  2. if (isPR) {
  3. checkout scm:[$class: 'GitSCM', userRemoteConfigs: [[ url: repoURL, credentialsId: gitCredentialId ]]]
  4. sh "git fetch origin pull/'${numberPR}'/head:'${BRANCH_NAME}'"
  5. sh "git checkout '${BRANCH_NAME}'"
  6. } else {
  7. checkout scm:[$class: 'GitSCM', userRemoteConfigs: [[ url: repoURL, credentialsId: gitCredentialId ]]]
  8. sh 'git checkout master'
  9. }
Add Comment
Please, Sign In to add comment