]> source.dussan.org Git - vaadin-core.git/commitdiff
Add "zip" Gulp task to create the zip package for a release 51/head pr51/r1
authorTeemu Pöntelin <teemu@vaadin.com>
Mon, 30 May 2016 11:26:07 +0000 (14:26 +0300)
committerTeemu Pöntelin <teemu@vaadin.com>
Tue, 31 May 2016 06:25:13 +0000 (09:25 +0300)
gulpfile.js
tasks/config.js
tasks/zip.js [new file with mode: 0644]

index eb04af89b30ec9fc6b7a3ab9442146773456cb34..9f60d08a352ba1fc20ca9dc4be97478dbd649f67 100644 (file)
@@ -7,9 +7,9 @@ var git = require('gulp-git');
 var version = '0.3.0';
 
 gulp.task('default', function() {
-  console.log('\n  Use:\n gulp <stage|deploy[:cdn]>\n');
+  console.log('\n  Use:\n gulp <stage|deploy[:cdn]>|<zip>\n');
 });
 
-gulp.task('clean', ['clean:cdn']);
+gulp.task('clean', ['clean:cdn', 'clean:zip']);
 
 gulp.task('deploy', ['deploy:cdn']);
index 3034ab8ec3eeb927c894d30242d39b9cb44531c6..61d550f9e0d02f073768c8551226e6a4d091cc8b 100644 (file)
@@ -12,6 +12,7 @@ module.exports = {
     staging: {
       bower: 'target/bower',
       cdn: 'target/cdn',
+      zip: 'target/zip',
       doc: 'target/docsite'
     },
     userhome: userhome,
diff --git a/tasks/zip.js b/tasks/zip.js
new file mode 100644 (file)
index 0000000..cc469eb
--- /dev/null
@@ -0,0 +1,19 @@
+var config = require('./config');
+var fs = require('fs-extra');
+var gulp = require('gulp');
+var zip = require('gulp-zip');
+
+var stagingPath = config.paths.staging.zip;
+var version = config.version;
+var filename = 'vaadin-core-elements-' + version + '.zip';
+var majorMinorVersion = version.replace(/(\d+\.\d+)(\.|-)(.*)/, '$1');
+
+gulp.task('clean:zip', function() {
+  fs.removeSync(stagingPath);
+});
+
+gulp.task('zip', ['clean:zip', 'stage:cdn'], function() {
+  return gulp.src(config.paths.staging.cdn + '/' + version + '/**/*')
+    .pipe(zip(filename))
+    .pipe(gulp.dest(stagingPath));
+});