gulp-modular-release
Advanced tools
Comparing version 0.3.0 to 0.4.0
48
index.js
@@ -16,2 +16,3 @@ 'use strict'; | ||
versionNumber: argv.v, | ||
hotfixBranch: argv.b, | ||
bumpFiles: ['./package.json', './bower.json'], | ||
@@ -37,11 +38,27 @@ changelogFile: './CHANGELOG.md', | ||
// tasks | ||
gulp.task('checkoutDevelop', function(done) { | ||
git.checkout(config.developBranch, {}, done); | ||
gulp.task('checkoutMaster', function(done) { | ||
git.checkout(config.masterBranch, {}, done); | ||
}); | ||
gulp.task('pullDevelop', ['checkoutDevelop'], function(done) { | ||
git.pull(config.origin, config.developBranch , {args: '--ff-only'}, done); | ||
gulp.task('pullMaster', ['checkoutMaster'], function(done) { | ||
git.pull(config.origin, config.masterBranch, {}, done); | ||
}); | ||
gulp.task('bump', ['pullDevelop'], function(done) { | ||
gulp.task('checkoutSourceBranch', ['pullMaster'], function(done) { | ||
if (config.hotfixBranch) { | ||
git.checkout(config.hotfixBranch, {}, done); | ||
} else { | ||
git.checkout(config.developBranch, {}, done); | ||
} | ||
}); | ||
gulp.task('pullSourceBranch', ['checkoutSourceBranch'], function(done) { | ||
if (!config.hotfixBranch) { | ||
git.pull(config.origin, config.developBranch, {args: '--ff-only'}, done); | ||
} else { | ||
done(); | ||
} | ||
}); | ||
gulp.task('bump', ['pullSourceBranch'], function(done) { | ||
if (config.versionNumber) { | ||
@@ -92,4 +109,7 @@ | ||
gulp.task('createBranch', ['bump'], function(cb) { | ||
console.log('switch', config.releaseBranch + config.versionNumber); | ||
git.checkout(config.releaseBranch + config.versionNumber, {args: '-b'}, cb); | ||
if (!config.hotfixBranch) { | ||
git.checkout(config.releaseBranch + config.versionNumber, {args: '-b'}, cb); | ||
} else { | ||
cb(); | ||
} | ||
}); | ||
@@ -112,3 +132,7 @@ | ||
function mergeInMaster() { | ||
git.merge(config.releaseBranch + config.versionNumber, {args: '--no-ff'}, tagVersion); | ||
if (config.hotfixBranch) { | ||
git.merge(config.hotfixBranch, {args: '--no-ff'}, tagVersion); | ||
} else { | ||
git.merge(config.releaseBranch + config.versionNumber, {args: '--no-ff'}, tagVersion); | ||
} | ||
} | ||
@@ -125,7 +149,11 @@ | ||
function mergeInDevelop() { | ||
git.merge(config.masterBranch, {args: '--no-ff'}, deleteBranch); | ||
git.merge(config.masterBranch, {args: '-s ours'}, deleteBranch); | ||
} | ||
function deleteBranch() { | ||
git.branch(config.releaseBranch + config.versionNumber, {args: '-d'}, pushBranches); | ||
if (config.hotfixBranch) { | ||
git.branch(config.hotfixBranch, {args: '-d'}, pushBranches); | ||
} else { | ||
git.branch(config.releaseBranch + config.versionNumber, {args: '-d'}, pushBranches); | ||
} | ||
} | ||
@@ -132,0 +160,0 @@ |
{ | ||
"name": "gulp-modular-release", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Modular extension to release projects using git-flow release strategy", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -43,2 +43,6 @@ # gulp-modular-release [![npm version](https://badge.fury.io/js/gulp-modular-release.svg)](https://www.npmjs.com/package/gulp-modular-release) [![Dependency Status](https://gemnasium.com/ONE-LOGIC/gulp-modular-release.svg)](https://gemnasium.com/ONE-LOGIC/gulp-modular-release) | ||
``` | ||
gulp release | ||
or | ||
gulp release -v 1.2.3 | ||
@@ -48,3 +52,7 @@ | ||
gulp release | ||
gulp relrease -b hotfix/foobar | ||
or | ||
gulp relrease -b hotfix/foobar -v 1.2.3 | ||
``` | ||
@@ -56,10 +64,10 @@ (If no version is specified the next version is generated using [conventional-recommended-bump](https://github.com/stevemao/conventional-recommended-bump).) | ||
1. checks out `develop` branch and pulls `origin` for changes (`pull --only-ff`) | ||
2. creates branch `release/1.2.3` from `develop` | ||
2. creates branch `release/1.2.3` from `develop` (just without `-b` option) | ||
3. sets version number to `bower.json` and `package.json` | ||
4. generates and writes changelog via conventional changelog to `CHANGELOG.md` | ||
5. commits the previous changes | ||
6. merges `release/1.2.3` into `master` and tags it with `v1.2.3` | ||
6. merges `release/1.2.3` (or the specified branch) into `master` and tags it with `v1.2.3` | ||
7. merges `master` into `develop` | ||
8. deletes branch `release/1.2.3` | ||
8. deletes branch `release/1.2.3` (or the specified branch) | ||
9. checks out `develop` | ||
10. (optionally) pushes changes to remote repository |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8693
139
71