From d478906f9ccf157c001e5cd7d252ede139179c71 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Mon, 9 Jul 2018 15:29:44 -0400 Subject: [PATCH] Update to run new AppVeyor jobs AppVeyor builds got split into two jobs, `electron-x64` and `electron-ia32` --- script/ci-release-build.js | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/script/ci-release-build.js b/script/ci-release-build.js index d543c6d27f00..a2acc7486289 100644 --- a/script/ci-release-build.js +++ b/script/ci-release-build.js @@ -3,6 +3,11 @@ const request = require('request') const buildAppVeyorURL = 'https://windows-ci.electronjs.org/api/builds' const vstsURL = 'https://github.visualstudio.com/electron/_apis/build' +const appVeyorJobs = { + 'electron-x64': 'electron', + 'electron-ia32': 'electron-39ng6' +} + const circleCIJobs = [ 'electron-linux-arm', 'electron-linux-arm64', @@ -71,9 +76,19 @@ async function circleCIcall (buildUrl, targetBranch, job, options) { console.log(`CircleCI release build request for ${job} successful. Check ${circleResponse.build_url} for status.`) } -async function buildAppVeyor (targetBranch, options) { - console.log(`Triggering AppVeyor to run build on branch: ${targetBranch} with release flag.`) +function buildAppVeyor (targetBranch, options) { assert(process.env.APPVEYOR_TOKEN, 'APPVEYOR_TOKEN not found in environment') + const validJobs = Object.keys(appVeyorJobs) + if (options.job) { + assert(validJobs.includes(options.job), `Unknown AppVeyor CI job name: ${options.job}. Valid values are: ${validJobs}.`) + callAppVeyor(targetBranch, options.job, options) + } else { + validJobs.forEach((job) => callAppVeyor(targetBranch, job, options)) + } +} + +async function callAppVeyor (targetBranch, job, options) { + console.log(`Triggering AppVeyor to run build job: ${job} on branch: ${targetBranch} with release flag.`) let environmentVariables = {} if (options.ghRelease) { @@ -96,7 +111,7 @@ async function buildAppVeyor (targetBranch, options) { }, body: JSON.stringify({ accountName: 'AppVeyor', - projectSlug: 'electron', + projectSlug: appVeyorJobs[job], branch: targetBranch, environmentVariables }), @@ -106,13 +121,13 @@ async function buildAppVeyor (targetBranch, options) { console.log('Error calling AppVeyor:', err) }) const buildUrl = `https://windows-ci.electronjs.org/project/AppVeyor/electron/build/${appVeyorResponse.version}` - console.log(`AppVeyor release build request successful. Check build status at ${buildUrl}`) + console.log(`AppVeyor release build request for ${job} successful. Check build status at ${buildUrl}`) } function buildCircleCI (targetBranch, options) { const circleBuildUrl = `https://circleci.com/api/v1.1/project/github/electron/electron/tree/${targetBranch}?circle-token=${process.env.CIRCLE_TOKEN}` if (options.job) { - assert(circleCIJobs.includes(options.job), `Unknown CI job name: ${options.job}.`) + assert(circleCIJobs.includes(options.job), `Unknown CircleCI job name: ${options.job}. Valid values are: ${circleCIJobs}.`) circleCIcall(circleBuildUrl, targetBranch, options.job, options) } else { circleCIJobs.forEach((job) => circleCIcall(circleBuildUrl, targetBranch, job, options)) @@ -121,7 +136,7 @@ function buildCircleCI (targetBranch, options) { async function buildVSTS (targetBranch, options) { if (options.job) { - assert(vstsJobs.includes(options.job), `Unknown CI job name: ${options.job}.`) + assert(vstsJobs.includes(options.job), `Unknown VSTS CI job name: ${options.job}. Valid values are: ${vstsJobs}.`) } console.log(`Triggering VSTS to run build on branch: ${targetBranch} with release flag.`) assert(process.env.VSTS_TOKEN, 'VSTS_TOKEN not found in environment')