-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
59 lines (54 loc) · 1.37 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
var gulp = require('gulp');
var del = require('del');
var webserver = require('gulp-webserver');
var awspublish = require('gulp-awspublish');
var AWS = require('aws-sdk');
gulp.task('serve', function() {
gulp.src('.')
.pipe(webserver({
livereload: true,
directoryListing: true,
open: false
}));
});
gulp.task('clean', function() {
return del('build');
});
gulp.task('build', ['clean'], function() {
return gulp.src(
[
'bower_components/**/*.js',
'bower_components/**/*.css',
'bower_components/**/*.woff2',
'bower_components/**/*.woff',
'bower_components/**/*.ttf',
'css/**/*.css',
'js/**/*.js',
'index.html',
'img/**/*.png',
'!bower_components/**/tests/**',
'!bower_components/**/test/**',
'!bower_components/**/src/**',
], {
base: './'
}
)
.pipe(gulp.dest('build'));
});
gulp.task('publish', ['build'], function() {
var params = {
region: 'ap-northeast-1',
params: {
Bucket: 'touka.kagu.la',
},
credentials: new AWS.SharedIniFileCredentials({
profile: 'touka-publish'
}),
};
var publisher = awspublish.create(params);
return gulp.src(['build/**/*'])
.pipe(publisher.publish({}))
.pipe(publisher.sync('', [/^logs\//]))
.pipe(publisher.cache())
.pipe(awspublish.reporter());
});