Skip to content

Commit

Permalink
Merge pull request #414 from axa-ch/bugfix/release-waterfall-broken
Browse files Browse the repository at this point in the history
Bugfix/release waterfall broken
  • Loading branch information
AndyOGo authored Apr 25, 2018
2 parents 2e02fea + 425c738 commit 5f7f60e
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions stack/tasks/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ waterfall([
},
(whoami, stderr, callback) => {
// eslint-disable-next-line consistent-return
exec('npm owner ls', handleError(callback, (error, stdout) => {
if (stdout.trim().indexOf(whoami.trim()) === -1) {
exec('npm owner ls', (error, stdout) => {
const hasError = error || stdout.trim().indexOf(whoami.trim()) === -1;

if (hasError) {
console.log(chalk.red(outdent`
Attention: Your account ${chalk.bold(whoami)} has no publisher rights. Please contact the administrator
Expand Down Expand Up @@ -86,7 +88,9 @@ waterfall([
n: no
`));
}));

callback(null, whoami);
});
},
], (error) => {
if (error) {
Expand Down Expand Up @@ -177,7 +181,8 @@ const release = (type, version) => {
2. build the dist folder
3. bump the desired version
4. publish to npm
5. fast-foward merge ${DEVELOP_TRUNK} into ${MASTER_TRUNK} and push
5. merge ${DEVELOP_TRUNK} into ${MASTER_TRUNK} and push
6. sync ${DEVELOP_TRUNK} with ${MASTER_TRUNK} again
Please confirm that you want to proceed
`));
Expand Down Expand Up @@ -259,7 +264,18 @@ const confirmedRelease = (type, version) => {
handleSuccess(callback, () => {
console.log(chalk.cyan(outdent`
Step 5 complete! Publishing done successfully. Have fun!
Step 5 complete...
`));
}),
);
},
(stdout, stderr, callback) => {
exec(
`git checkout ${DEVELOP_TRUNK} && git merge --ff-only ${MASTER_TRUNK} && git push && git push --tags`,
handleSuccess(callback, () => {
console.log(chalk.cyan(outdent`
Step 6 complete! Publishing done successfully. Have fun!
`));
}),
Expand Down

0 comments on commit 5f7f60e

Please sign in to comment.