Sfoglia il codice sorgente

[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.
Alexander Köplinger 7 anni fa
parent
commit
b13145bb12

+ 4 - 4
scripts/ci/pipeline/osx-package.groovy

@@ -90,11 +90,11 @@ node ("osx-amd64") {
 }
 }
 
 
 if (!isPr || isWindowsPrBuild) {
 if (!isPr || isWindowsPrBuild) {
-    def parameters = null
+    def parameters = [[$class: 'StringParameterValue', name: 'sha1', value: commitHash]]
+
     if (isWindowsPrBuild) {
     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
     // trigger the Windows build

+ 3 - 0
scripts/ci/pipeline/win-package.groovy

@@ -16,6 +16,9 @@ node ("w64") {
                 // clone and checkout repo
                 // clone and checkout repo
                 checkout scm
                 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
                 // get current commit sha
                 commitHash = sh (script: 'git rev-parse HEAD', returnStdout: true).trim()
                 commitHash = sh (script: 'git rev-parse HEAD', returnStdout: true).trim()
                 currentBuild.displayName = "${commitHash.substring(0,7)}"
                 currentBuild.displayName = "${commitHash.substring(0,7)}"