Skip to content

Commit

Permalink
Add skipCI flag to release script (#13933)
Browse files Browse the repository at this point in the history
  • Loading branch information
bvaughn committed Oct 23, 2018
1 parent d42ed60 commit f4488be
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
18 changes: 18 additions & 0 deletions scripts/release/build-commands/check-circle-ci-status.js
Expand Up @@ -4,6 +4,8 @@

const chalk = require('chalk');
const http = require('request-promise-json');
const logUpdate = require('log-update');
const prompt = require('prompt-promise');
const {execRead, logPromise} = require('../utils');

// https://circleci.com/docs/api/v1-reference/#projects
Expand Down Expand Up @@ -46,5 +48,21 @@ module.exports = async params => {
if (params.local) {
return;
}

if (params.skipCI) {
logUpdate(chalk.red`Are you sure you want to skip CI? (y for yes, n for no)`);
const confirm = await prompt('');
logUpdate.done();
if (confirm === 'y') {
return;
} else {
throw Error(
chalk`
Cancelling release.
`
);
}
}

return logPromise(check(params), 'Checking CircleCI status');
};
2 changes: 1 addition & 1 deletion scripts/release/build-commands/update-git.js
Expand Up @@ -21,6 +21,6 @@ module.exports = async params => {
update(params),
`Updating checkout ${chalk.yellow.bold(
params.cwd
)} on branch ${chalk.yellow.bold(params.branch)}}`
)} on branch ${chalk.yellow.bold(params.branch)}`
);
};
6 changes: 6 additions & 0 deletions scripts/release/config.js
Expand Up @@ -43,6 +43,12 @@ const paramDefinitions = [
'The npm dist tag; defaults to [bold]{latest} for a stable' +
'release, [bold]{next} for unstable',
},
{
name: 'skipCI',
type: Boolean,
description:
'Skip Circle CI status check (requires confirmation)',
},
];

module.exports = {
Expand Down

0 comments on commit f4488be

Please sign in to comment.