Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add skipCI flag to release script #13933

Merged
merged 1 commit into from Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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