build: better error handling for release builds (#28621)
This commit is contained in:
parent
6df2680cb6
commit
f78f8d15a9
1 changed files with 24 additions and 14 deletions
|
@ -235,11 +235,14 @@ async function callAppVeyor (targetBranch, job, options) {
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
};
|
};
|
||||||
jobRequestedCount++;
|
jobRequestedCount++;
|
||||||
const appVeyorResponse = await makeRequest(requestOpts, true).catch(err => {
|
|
||||||
console.log('Error calling AppVeyor:', err);
|
try {
|
||||||
});
|
const { version } = await makeRequest(requestOpts, true);
|
||||||
const buildUrl = `https://ci.appveyor.com/project/electron-bot/${appVeyorJobs[job]}/build/${appVeyorResponse.version}`;
|
const buildUrl = `https://ci.appveyor.com/project/electron-bot/${appVeyorJobs[job]}/build/${version}`;
|
||||||
console.log(`AppVeyor release build request for ${job} successful. Check build status at ${buildUrl}`);
|
console.log(`AppVeyor release build request for ${job} successful. Check build status at ${buildUrl}`);
|
||||||
|
} catch (err) {
|
||||||
|
console.log('Could not call AppVeyor: ', err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildCircleCI (targetBranch, options) {
|
function buildCircleCI (targetBranch, options) {
|
||||||
|
@ -281,12 +284,16 @@ async function buildVSTS (targetBranch, options) {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
jobRequestedCount++;
|
jobRequestedCount++;
|
||||||
const vstsResponse = await makeRequest(requestOpts, true).catch(err => {
|
|
||||||
console.log('Error calling VSTS to get build definitions:', err);
|
try {
|
||||||
});
|
const vstsResponse = await makeRequest(requestOpts, true);
|
||||||
const buildToRun = vstsResponse.value.find(build => build.name === options.job);
|
const buildToRun = vstsResponse.value.find(build => build.name === options.job);
|
||||||
callVSTSBuild(buildToRun, targetBranch, environmentVariables, vstsURL, vstsToken);
|
callVSTSBuild(buildToRun, targetBranch, environmentVariables, vstsURL, vstsToken);
|
||||||
|
} catch (err) {
|
||||||
|
console.log('Problem calling VSTS to get build definitions: ', err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function callVSTSBuild (build, targetBranch, environmentVariables, vstsURL, vstsToken) {
|
async function callVSTSBuild (build, targetBranch, environmentVariables, vstsURL, vstsToken) {
|
||||||
|
@ -310,10 +317,13 @@ async function callVSTSBuild (build, targetBranch, environmentVariables, vstsURL
|
||||||
body: JSON.stringify(buildBody),
|
body: JSON.stringify(buildBody),
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
};
|
};
|
||||||
const vstsResponse = await makeRequest(requestOpts, true).catch(err => {
|
|
||||||
console.log(`Error calling VSTS for job ${build.name}`, err);
|
try {
|
||||||
});
|
const { _links } = await makeRequest(requestOpts, true);
|
||||||
console.log(`VSTS release build request for ${build.name} successful. Check ${vstsResponse._links.web.href} for status.`);
|
console.log(`VSTS release build request for ${build.name} successful. Check ${_links.web.href} for status.`);
|
||||||
|
} catch (err) {
|
||||||
|
console.log(`Could not call VSTS for job ${build.name}: `, err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function runRelease (targetBranch, options) {
|
function runRelease (targetBranch, options) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue