-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
62 lines (54 loc) · 1.73 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
clean = require('gulp-clean'),
zip = require('gulp-zip'),
bump = require('gulp-bump'),
runSequence = require('run-sequence');
var BUILD_PATH = 'build',
DIST_PATH = 'dist',
SOURCE_PATH = '.',
RELEASE_VERSION = '0.0.1';
gulp.task('deploy', function (callback) {
runSequence('clean',
'build',
'set_version',
'generate_artifacts');
});
gulp.task('clean', function () {
console.log("Clean all files in build and dist folders");
return gulp.src([BUILD_PATH + '/*', DIST_PATH + '/*'], {
read: false
}).pipe(clean());
});
gulp.task('generate_artifacts', function () {
console.log('Packaging all project files to zip');
return gulp.src(BUILD_PATH + '/**')
.pipe(zip('omsklug-image-' + RELEASE_VERSION + '.zip'))
.pipe(gulp.dest(DIST_PATH));
});
function build() {
console.log("Copying project to build folder");
return gulp.src([SOURCE_PATH + '/**',
'!' + SOURCE_PATH + '/node_modules',
'!' + SOURCE_PATH + '/node_modules/**',
'!' + SOURCE_PATH + '/build',
'!' + SOURCE_PATH + '/build/**',
'!' + SOURCE_PATH + '/dist',
'!' + SOURCE_PATH + '/dist/**',
'!' + SOURCE_PATH + '/nbproject',
'!' + SOURCE_PATH + '/nbproject/**'
], {
base: '.'
}).pipe(gulp.dest('build'));
}
gulp.task('build', build);
gulp.task('set_version', function () {
gulp.src("./package.json")
.pipe(bump({
version: RELEASE_VERSION
}))
.pipe(gulp.dest('./' + BUILD_PATH));
});
gulp.task('default', function () {
console.log("default");
});