diff options
author | Alexander Köplinger <alex.koeplinger@outlook.com> | 2019-07-17 02:01:33 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2019-07-17 02:01:42 +0300 |
commit | 39472e06a3b73a5fc053ed6dc327e8f095e47903 (patch) | |
tree | 78432080001e26105a6f9353aa7c62b987b1a916 /scripts | |
parent | 978653633b976b65497c931252c6fb8b8724a2a9 (diff) |
[ci] Wait for signing outside of a node() block
We don't need to block the machine just for waiting on signing to finish.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/ci/pipeline/osx-package.groovy | 76 | ||||
-rw-r--r-- | scripts/ci/pipeline/win-package.groovy | 94 |
2 files changed, 87 insertions, 83 deletions
diff --git a/scripts/ci/pipeline/osx-package.groovy b/scripts/ci/pipeline/osx-package.groovy index 88cf5209207..b34b5f4d2ad 100644 --- a/scripts/ci/pipeline/osx-package.groovy +++ b/scripts/ci/pipeline/osx-package.groovy @@ -11,25 +11,26 @@ def utils = null // compression is incompatible with JEP-210 right now properties([ /* compressBuildLog() */ ]) -node (isPr ? "mono-package-pr" : "mono-package") { - ws ("workspace/${jobName}/${monoBranch}") { - timestamps { - stage('Checkout') { - echo "Running on ${env.NODE_NAME}" +try { + timestamps { + node(isPr ? "mono-package-pr" : "mono-package") { + ws("workspace/${jobName}/${monoBranch}") { + stage('Checkout') { + echo "Running on ${env.NODE_NAME}" - // clone and checkout repo - checkout scm + // clone and checkout repo + checkout scm - // remove old stuff - sh 'git clean -xdff' + // remove old stuff + sh 'git clean -xdff' - // get current commit sha - commitHash = sh (script: 'git rev-parse HEAD', returnStdout: true).trim() - currentBuild.displayName = "${commitHash.substring(0,7)}" + // get current commit sha + commitHash = sh (script: 'git rev-parse HEAD', returnStdout: true).trim() + currentBuild.displayName = "${commitHash.substring(0,7)}" + + utils = load "scripts/ci/pipeline/utils.groovy" + } - utils = load "scripts/ci/pipeline/utils.groovy" - } - try { stage('Build') { utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'PKG-mono', env.BUILD_URL, 'PENDING', 'Building...') @@ -49,6 +50,7 @@ node (isPr ? "mono-package-pr" : "mono-package") { // move mac-entitlements.plist to the workspace root sh 'mv mono/mini/mac-entitlements.plist .' } + stage('Upload .pkg to Azure') { azureUpload(storageCredentialId: (isPrivate ? "bc6a99d18d7d9ca3f6bf6b19e364d564" : "fbd29020e8166fbede5518e038544343"), storageType: "blobstorage", @@ -60,34 +62,34 @@ node (isPr ? "mono-package-pr" : "mono-package") { doNotWaitForPreviousBuild: true, uploadArtifactsOnlyIfSuccessful: true) } + } + } - if (isReleaseJob) { - stage("Signing") { - timeout(time: 90, unit: 'MINUTES') { - // waits until the signing job posts completion signal to this pipeline input - input id: 'FinishedSigning', message: 'Waiting for signing to finish (please be patient)...', submitter: 'monojenkins' - echo "Signing done." - } - } + if (isReleaseJob) { + stage("Signing") { + timeout(time: 90, unit: 'MINUTES') { + // waits until the signing job posts completion signal to this pipeline input + input id: 'FinishedSigning', message: 'Waiting for signing to finish (please be patient)...', submitter: 'monojenkins' + echo "Signing done." } - else { - echo "Not a release job, skipping signing." - } - - def downloadHost = (isPrivate ? "dl.internalx.com" : "xamjenkinsartifact.azureedge.net") - def packageUrl = "https://${downloadHost}/${jobName}/${monoBranch}/${env.BUILD_NUMBER}/${commitHash}" - currentBuild.description = "<hr/><h2>DOWNLOAD: <a href=\"${packageUrl}/${packageFileName}\">${packageFileName}</a></h2><hr/>" - - if (isReleaseJob) { utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'artifacts.json', "${packageUrl}/artifacts.json", 'SUCCESS', '') } - utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'PKG-mono', "${packageUrl}/${packageFileName}", 'SUCCESS', packageFileName) - } - catch (Exception e) { - utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'PKG-mono', env.BUILD_URL, 'FAILURE', "Build failed.") - throw e } } + else { + echo "Not a release job, skipping signing." + } + + def downloadHost = (isPrivate ? "dl.internalx.com" : "xamjenkinsartifact.azureedge.net") + def packageUrl = "https://${downloadHost}/${jobName}/${monoBranch}/${env.BUILD_NUMBER}/${commitHash}" + currentBuild.description = "<hr/><h2>DOWNLOAD: <a href=\"${packageUrl}/${packageFileName}\">${packageFileName}</a></h2><hr/>" + + if (isReleaseJob) { utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'artifacts.json', "${packageUrl}/artifacts.json", 'SUCCESS', '') } + utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'PKG-mono', "${packageUrl}/${packageFileName}", 'SUCCESS', packageFileName) } } +catch (Exception e) { + utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'PKG-mono', env.BUILD_URL, 'FAILURE', "Build failed.") + throw e +} if (isPrivate) { // skip Windows build on private jobs for now diff --git a/scripts/ci/pipeline/win-package.groovy b/scripts/ci/pipeline/win-package.groovy index acfa65ccb01..1f163f7c613 100644 --- a/scripts/ci/pipeline/win-package.groovy +++ b/scripts/ci/pipeline/win-package.groovy @@ -10,33 +10,35 @@ def utils = null // compression is incompatible with JEP-210 right now properties([ /* compressBuildLog() */]) -node ("w64") { - ws ("workspace/${jobName}/${monoBranch}") { - timestamps { - stage('Checkout') { - echo "Running on ${env.NODE_NAME}" +try { + timestamps { + node("w64") { + ws("workspace/${jobName}/${monoBranch}") { + stage('Checkout') { + echo "Running on ${env.NODE_NAME}" - // clone and checkout repo - checkout scm + // 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") + // 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)}" + // get current commit sha + commitHash = sh (script: 'git rev-parse HEAD', returnStdout: true).trim() + currentBuild.displayName = "${commitHash.substring(0,7)}" + + utils = load "scripts/ci/pipeline/utils.groovy" + } + + stage('Download Mac .pkg from Azure') { + azureDownload(storageCredentialId: "fbd29020e8166fbede5518e038544343", + downloadType: "project", + buildSelector: upstream(), + projectName: "${macJobName}", + flattenDirectories: true, + includeFilesPattern: "**/*.pkg") + } - utils = load "scripts/ci/pipeline/utils.groovy" - } - stage('Download Mac .pkg from Azure') { - azureDownload(storageCredentialId: "fbd29020e8166fbede5518e038544343", - downloadType: "project", - buildSelector: upstream(), - projectName: "${macJobName}", - flattenDirectories: true, - includeFilesPattern: "**/*.pkg") - } - try { stage('Build') { utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'MSI-mono_x86', env.BUILD_URL, 'PENDING', 'Building...') utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'MSI-mono_x64', env.BUILD_URL, 'PENDING', 'Building...') @@ -81,32 +83,32 @@ node ("w64") { doNotWaitForPreviousBuild: true, uploadArtifactsOnlyIfSuccessful: true) } + } + } - if (isReleaseJob) { - stage("Signing") { - timeout(time: 30, unit: 'MINUTES') { - // waits until the signing job posts completion signal to this pipeline input - input id: 'FinishedSigning', message: 'Waiting for signing to finish...', submitter: 'monojenkins' - echo "Signing done." - } - } - } - else { - echo "Not a release job, skipping signing." + if (isReleaseJob) { + stage("Signing") { + timeout(time: 30, unit: 'MINUTES') { + // waits until the signing job posts completion signal to this pipeline input + input id: 'FinishedSigning', message: 'Waiting for signing to finish (please be patient)...', submitter: 'monojenkins' + echo "Signing done." } - - def packageUrlX86 = "https://xamjenkinsartifact.azureedge.net/${jobName}/${monoBranch}/${env.BUILD_NUMBER}/${commitHash}/${packageFileNameX86}" - def packageUrlX64 = "https://xamjenkinsartifact.azureedge.net/${jobName}/${monoBranch}/${env.BUILD_NUMBER}/${commitHash}/${packageFileNameX64}"; - - currentBuild.description = "<hr/><h2>DOWNLOAD: <a href=\"${packageUrlX86}\">${packageFileNameX86}</a> -- <a href=\"${packageUrlX64}\">${packageFileNameX64}</a></h2><hr/>" - utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'MSI-mono_x86', packageUrlX86, 'SUCCESS', packageFileNameX86) - utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'MSI-mono_x64', packageUrlX64, 'SUCCESS', packageFileNameX64) - } - catch (Exception e) { - utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'MSI-mono_x86', env.BUILD_URL, 'FAILURE', "Build failed.") - utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'MSI-mono_x64', env.BUILD_URL, 'FAILURE', "Build failed.") - throw e } } + else { + echo "Not a release job, skipping signing." + } + + def packageUrlX86 = "https://xamjenkinsartifact.azureedge.net/${jobName}/${monoBranch}/${env.BUILD_NUMBER}/${commitHash}/${packageFileNameX86}" + def packageUrlX64 = "https://xamjenkinsartifact.azureedge.net/${jobName}/${monoBranch}/${env.BUILD_NUMBER}/${commitHash}/${packageFileNameX64}"; + + currentBuild.description = "<hr/><h2>DOWNLOAD: <a href=\"${packageUrlX86}\">${packageFileNameX86}</a> -- <a href=\"${packageUrlX64}\">${packageFileNameX64}</a></h2><hr/>" + utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'MSI-mono_x86', packageUrlX86, 'SUCCESS', packageFileNameX86) + utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'MSI-mono_x64', packageUrlX64, 'SUCCESS', packageFileNameX64) } } +catch (Exception e) { + utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'MSI-mono_x86', env.BUILD_URL, 'FAILURE', "Build failed.") + utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'MSI-mono_x64', env.BUILD_URL, 'FAILURE', "Build failed.") + throw e +} |