diff options
author | Evan Lojewski <github@meklort.com> | 2020-07-12 09:06:59 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-12 09:06:59 -0600 |
commit | 1d0a5f61fbe17c4e7e0b4da0b405aa72aedc77b5 (patch) | |
tree | e69f03720c87e1e761650352379ff0f89bbe6fbe /.jenkins.groovy | |
parent | 76db92af3f904b1c1d78b113510f2fb9f2eb6b29 (diff) | |
download | bcm5719-ortega-1d0a5f61fbe17c4e7e0b4da0b405aa72aedc77b5.tar.gz bcm5719-ortega-1d0a5f61fbe17c4e7e0b4da0b405aa72aedc77b5.zip |
regressions: Enable building pull requests. (#88)
Diffstat (limited to '.jenkins.groovy')
-rw-r--r-- | .jenkins.groovy | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/.jenkins.groovy b/.jenkins.groovy index a020450..b912dca 100644 --- a/.jenkins.groovy +++ b/.jenkins.groovy @@ -59,12 +59,37 @@ def build(nodeName) { node(nodeName) { + cleanWs() + def URL = '' + def REFSPEC = '+refs/heads/*:refs/remotes/origin/*' + try { + URL = GITHUB_REPO_GIT_URL + } + catch (exc) + { + URL = 'git://github.com/meklort/bcm5719-fw.git' + } + def HASH = '' + try { + HASH = GITHUB_BRANCH_HEAD_SHA + } + catch (exc) + { + try { + HASH = GITHUB_PR_HEAD_SHA + REFSPEC = '+refs/pull/*:refs/remotes/origin/pr/*' + } + catch (exc2) + { + HASH = '**' + } + } stage('checkout') { checkout( - [$class: 'GitSCM', branches: [[name: '**']], + [$class: 'GitSCM', branches: [[name: HASH]], browser: [$class: 'GithubWeb', - repoUrl: 'https://github.com/'], + repoUrl: 'https://github.com/meklort/bcm5719-fw/'], doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'SubmoduleOption', @@ -74,7 +99,11 @@ def build(nodeName) reference: '', trackingSubmodules: false]], submoduleCfg: [], - userRemoteConfigs: [[url: 'https://github.com/meklort/bcm5719-fw.git']]]) + userRemoteConfigs: [[ + url: URL, + refspec: REFSPEC + ]] + ]) } stage('build') |