diff options
author | Alexander Köplinger <alex.koeplinger@outlook.com> | 2018-10-04 15:18:52 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2018-10-04 15:21:59 +0300 |
commit | b13145bb12b7561ea6c72962824fef107d8eac03 (patch) | |
tree | b34bd49ec98fc658dce88b75aa95c5cab879b19a /scripts/ci | |
parent | a7f5952c69ae76015ccaefd4dfa8be2274498a21 (diff) |
[ci] Always pass sha1 from Mac to Windows packaging build
Before we only did this for PR builds but it turns out it's needed for
normal master/branch builds too.
In situations where there are two Mac builds at roughly the same time
the downstream Windows builds would otherwise both refer to the same/latest
commit since they just checkout the latest ref on the branch.
Now we reset the Windows build to the sha1 which is passed to it.
Diffstat (limited to 'scripts/ci')
-rw-r--r-- | scripts/ci/pipeline/osx-package.groovy | 8 | ||||
-rw-r--r-- | scripts/ci/pipeline/win-package.groovy | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/scripts/ci/pipeline/osx-package.groovy b/scripts/ci/pipeline/osx-package.groovy index e90e9e2542c..001c07c92d9 100644 --- a/scripts/ci/pipeline/osx-package.groovy +++ b/scripts/ci/pipeline/osx-package.groovy @@ -90,11 +90,11 @@ node ("osx-amd64") { } if (!isPr || isWindowsPrBuild) { - def parameters = null + def parameters = [[$class: 'StringParameterValue', name: 'sha1', value: commitHash]] + if (isWindowsPrBuild) { - parameters = [[$class: 'StringParameterValue', name: 'sha1', value: commitHash], - [$class: 'StringParameterValue', name: 'ghprbPullId', value: env.ghprbPullId], - [$class: 'StringParameterValue', name: 'ghprbActualCommit', value: env.ghprbActualCommit]] + parameters += [$class: 'StringParameterValue', name: 'ghprbPullId', value: env.ghprbPullId] + parameters += [$class: 'StringParameterValue', name: 'ghprbActualCommit', value: env.ghprbActualCommit] } // trigger the Windows build diff --git a/scripts/ci/pipeline/win-package.groovy b/scripts/ci/pipeline/win-package.groovy index afb6cd3d08e..3f946892a81 100644 --- a/scripts/ci/pipeline/win-package.groovy +++ b/scripts/ci/pipeline/win-package.groovy @@ -16,6 +16,9 @@ node ("w64") { // clone and checkout repo checkout scm + // we need to reset to the commit sha passed to us by the upstream Mac build + sh (script: "git reset --hard ${env.sha1} && git submodule update --recursive") + // get current commit sha commitHash = sh (script: 'git rev-parse HEAD', returnStdout: true).trim() currentBuild.displayName = "${commitHash.substring(0,7)}" |