-
Notifications
You must be signed in to change notification settings - Fork 14
/
gulpfile.js
35 lines (30 loc) · 910 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
35
var gulp = require('gulp'),
zip = require('gulp-zip'),
del = require('del'),
install = require('gulp-install'),
runSequence = require('run-sequence'),
lambda = require("node-aws-lambda"),
rimraf = require('rimraf');
//load release-it tasks
require('gulp-release-it')(gulp);
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) {
lambda.deploy('./tmp/dist.zip', require('./config/'+process.env.APP+'.config.js'), callback);
});
gulp.task('deploy', function(callback) {
return runSequence(
['modules'],
['zip'],
['upload'],
callback
);
});