Add skipCI flag to release script (#13933)
Brian Vaughn committed
Oct 23, 2018 at 15:05 UTC
f4488bee514aba9a17b2498aa8e3b300e5149954
3 files changed
+25
-1
scripts/release/build-commands/check-circle-ci-status.js
+18
@@ -4,6 +4,8 @@
4
5
const chalk = require('chalk');
6
const http = require('request-promise-json');
7
+const logUpdate = require('log-update');
8
+const prompt = require('prompt-promise');
9
const {execRead, logPromise} = require('../utils');
10
11
// https://circleci.com/docs/api/v1-reference/#projects
@@ -46,5 +48,21 @@ module.exports = async params => {
48
if (params.local) {
49
return;
50
}
51
+
52
+ if (params.skipCI) {
53
+ logUpdate(chalk.red`Are you sure you want to skip CI? (y for yes, n for no)`);
54
+ const confirm = await prompt('');
55
+ logUpdate.done();
56
+ if (confirm === 'y') {
57
+ return;
58
+ } else {
59
+ throw Error(
60
+ chalk`
61
+ Cancelling release.
62
+ `
63
+ );
64
+ }
65
+ }
66
+
67
return logPromise(check(params), 'Checking CircleCI status');
68
};
scripts/release/build-commands/update-git.js
+1
-1
@@ -21,6 +21,6 @@ module.exports = async params => {
21
update(params),
22
`Updating checkout ${chalk.yellow.bold(
23
params.cwd
24
- )} on branch ${chalk.yellow.bold(params.branch)}}`
24
+ )} on branch ${chalk.yellow.bold(params.branch)}`
25
);
26
};
scripts/release/config.js
+6
@@ -43,6 +43,12 @@ const paramDefinitions = [
43
'The npm dist tag; defaults to [bold]{latest} for a stable' +
44
'release, [bold]{next} for unstable',
45
},
46
+ {
47
+ name: 'skipCI',
48
+ type: Boolean,
49
+ description:
50
+ 'Skip Circle CI status check (requires confirmation)',
51
+ },
52
];
53
54
module.exports = {