forked from elastic/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
34 lines (28 loc) · 883 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var gulp = require('gulp'),
zip = require('gulp-zip'),
tar = require('gulp-tar'),
gzip = require('gulp-gzip'),
del = require('del'),
package = require('./package.json');
var version = package.version;
gulp.task('stage', ['clean'], function(cb) {
return gulp.src(['**/*', '!node_modules/**', '!node_modules'])
.pipe(gulp.dest('stage/elasticsearch-demo-' + version));
});
gulp.task('zip', [], function() {
return gulp.src(['stage/**/*'])
.pipe(zip('elasticsearch-demo-' + version + '.zip'))
.pipe(gulp.dest('dist'));
});
gulp.task('tar', [], function() {
return gulp.src(['stage/**/*'])
.pipe(tar('elasticsearch-demo-' + version + '.tar'))
.pipe(gzip())
.pipe(gulp.dest('dist'));
});
gulp.task('clean', function(cb) {
del(['dist', 'stage'], cb)
});
gulp.task('default', ['clean', 'stage'], function() {
gulp.start('zip', 'tar');
});