-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgulpfile.js
41 lines (35 loc) · 1.02 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
var gulp = require('gulp');
var zip = require('gulp-zip');
var del = require('del');
var install = require('gulp-install');
var runSequence = require('run-sequence');
var awsLambda = require("node-aws-lambda");
var bump = require('gulp-bump');
var gulp = require('gulp');
require('gulp-release-it')(gulp);
gulp.task('bump', function(){
gulp.src('./package.json')
.pipe(bump({key: "version"}))
.pipe(gulp.dest('./'));
});
gulp.task('modules', function() {
return gulp.src('./package.json')
.pipe(gulp.dest('dist/'))
.pipe(install({production: true}));
});
gulp.task('zip', function() {
return gulp.src(['dist/**/*', '!dist/package.json'])
.pipe(zip('./tmp/dist.zip'))
.pipe(gulp.dest('./'));
});
gulp.task('upload', function(callback) {
awsLambda.deploy('./tmp/dist.zip', require('./config/'+process.env.APP), callback);
});
gulp.task('deploy', function(callback) {
return runSequence(
['modules'],
['zip'],
['upload'],
callback
);
});