From 16b2388d2407ad1bf3c3bf5c13229eb358ee4947 Mon Sep 17 00:00:00 2001 From: Vladimir Lugovsky Date: Thu, 3 Dec 2015 19:18:19 +0300 Subject: [PATCH] feat(build): added marketplace release task --- gulpfile.js | 22 ++++++++++++++++++++++ package.json | 5 ++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 6a1b8e9..7c42c6e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -11,6 +11,9 @@ var uglify = require('gulp-uglify'); var eventStream = require('event-stream'); var templateCache = require('gulp-angular-templatecache'); var minifyHTML = require('gulp-minify-html'); +var zip = require('gulp-zip'); +var prompt = require('gulp-prompt'); +var rename = require('gulp-rename'); var bootstrapCssSrc = 'bower_components/bootstrap/dist/css/bootstrap.min.css'; @@ -167,4 +170,23 @@ gulp.task('watch', function () { gulp.task('init', ['minify-css', 'imagemin', 'js-lib', 'js', 'font', 'templateCache', 'html']); +gulp.task('marketplace-release', ['init'], function() { + return gulp.src('') + .pipe(prompt.prompt({ + type: 'input', + name: 'version', + message: 'Please enter release version (x.x.x)' + }, function(res){ + var nameAndVersion = 'blur-admin-' + res.version; + return gulp + .src(['src/**', 'release/**', 'bower.json', 'package.json', 'README.md', '.gitignore'], { base : "." }) + .pipe(rename(function (path) { + path.dirname = nameAndVersion + '/' + path.dirname; + })) + .pipe(zip(nameAndVersion + '.zip')) + .pipe(gulp.dest('.')); + })); + +}); + gulp.task('default', ['init']); \ No newline at end of file diff --git a/package.json b/package.json index 9806962..bebb1f5 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "blur_admin", "version": "0.0.1", "devDependencies": { + "bower": "^1.5.2", "event-stream": "^3.3.1", "gulp": "^3.9.0", "gulp-angular-templatecache": "^1.7.0", @@ -11,10 +12,12 @@ "gulp-imagemin": "^2.3.0", "gulp-minify-css": "^1.2.1", "gulp-minify-html": "^1.0.4", + "gulp-prompt": "^0.1.2", + "gulp-rename": "^1.2.2", "gulp-sass": "^2.0.4", "gulp-strip-debug": "^1.0.2", "gulp-uglify": "^1.4.0", - "bower": "^1.5.2" + "gulp-zip": "^3.0.2" }, "scripts": { "postinstall": "bower install"