Files
react/scripts/release-manager/commands/start-release.js
Paul O’Shannessy 0fbe927486 [rrm] Create start-release command, create git utils
This does the essentials for starting a new release on the stable branch
2017-01-06 06:00:09 -08:00

45 lines
1.2 KiB
JavaScript

// fetch upstream
// checkout 15-dev, update
// merge upstream/15-stable in
// done
'use strict';
const chalk = require('chalk');
var git = require('./utils/git');
module.exports = function(vorpal, app) {
vorpal
.command('start-release')
.description('Start the process for shipping the next release')
.action(function(args) {
return new Promise((resolve, reject) => {
// TODO: ensure that repo has upstream remote, correct branches setup.
if (!git.isClean(app)) {
this.log('ERROR: repo not in clean state');
return reject();
}
// Fetch upstream - this ensures upstream/15-stable is updated and we
// won't rely on the local branch.
git.fetch(app, 'upstream');
// Checkout 15-dev
git.checkout(app, '15-dev');
// Update to ensure latest commits are in. Will hit network again but
// shouldn't need to get anything.
git.pull(app);
// Merge 15-stable in
git.merge(app, 'upstream/15-stable', false);
this.log(chalk.green.bold(`OK!`));
this.log(`You can now start cherry-picking commits to this branch using the "stable-prs" command.`);
resolve();
});
});
};