diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2017-05-23 22:02:50 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2017-05-23 22:02:50 -0700 |
commit | a119d2eb06e0b7d7fdfd97fc725bfbcf6594f9e1 (patch) | |
tree | 34b9a7411674f94d3a64c89dd0830fe9695357d9 | |
parent | 6091e11cae1e2ca43709266d0e3ba84ded12ddfc (diff) | |
download | cryptography-a119d2eb06e0b7d7fdfd97fc725bfbcf6594f9e1.tar.gz cryptography-a119d2eb06e0b7d7fdfd97fc725bfbcf6594f9e1.tar.bz2 cryptography-a119d2eb06e0b7d7fdfd97fc725bfbcf6594f9e1.zip |
master builds should use the commit at the time it was merged (#3577)
-rw-r--r-- | Jenkinsfile | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/Jenkinsfile b/Jenkinsfile index 7693d1af..adaf9f03 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -144,22 +144,39 @@ def checkout_git(label) { cd cryptography git fetch origin +refs/pull/${env.CHANGE_ID}/merge: git checkout -qf FETCH_HEAD - git rev-parse HEAD """ + if (label.contains("windows")) { + bat script + } else { + sh """#!/bin/sh + set -xe + ${script} + """ + } } else { - script = """ - git clone --depth=1 https://github.com/pyca/cryptography.git cryptography - cd cryptography - git checkout ${env.BRANCH_NAME} - git rev-parse HEAD - """ + checkout([ + $class: 'GitSCM', + branches: [[name: "*/${env.BRANCH_NAME}"]], + doGenerateSubmoduleConfigurations: false, + extensions: [[ + $class: 'RelativeTargetDirectory', + relativeTargetDir: 'cryptography' + ]], + submoduleCfg: [], + userRemoteConfigs: [[ + 'url': 'https://github.com/pyca/cryptography' + ]] + ]) } if (label.contains("windows")) { - bat script + bat """ + cd cryptography + git rev-parse HEAD + """ } else { - sh """#!/bin/sh - set -xe - ${script} + sh """ + cd cryptography + git rev-parse HEAD """ } } |