-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
57 lines (47 loc) · 1.71 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
var gulp = require('gulp');
if (!process.env.MCM_DB) {
process.env.MCM_DB = 'http://couchdb:5984';
}
if (!process.env.MCM_MAIL_HOST) {
process.env.MCM_MAIL_HOST = 'web-server';
}
if (!process.env.MCM_RABBIT_URL) {
process.env.MCM_RABBIT_URL = 'amqp://republichog:antigone123@web-server';
}
if (!process.env.DOMAIN) {
process.env.DOMAIN = 'rhog.ismymc.dev';
}
require('./gulp-tasks/gulp-db').initialize(gulp, process.env.MCM_DB);
var sync = require('./gulp-tasks/gulp-build').sync;
var webserver = require('./gulp-tasks/gulp-run')(sync).webserver;
require('./gulp-tasks/gulp-dist');
process.on('uncaughtException', function(err) {
console.error('UNCAUGHT EXCEPTION:');
console.error(err.message, err.stack);
try {
sync.exit();
} catch(e) {
console.error('Failed to kill browser sync.');
console.error(err.message, err.stack);
}
try {
webserver.kill();
} catch(e) {
console.error('Failed to kill development server.');
console.error(err.message, err.stack);
}
});
gulp.task('clean', [ 'dist:clean', 'build:clean' ]);
gulp.task('default', [ 'build' ]);
gulp.task('mailer', [ 'run:mailer', 'watch:mailer' ]);
gulp.task('dev', [ 'run:site', 'watch' ]);
gulp.task('watch', [ 'build' ], function () {
gulp.watch('./src/sites/scripts/*.js', [ 'build:es3-client' ]);
gulp.watch('./src/sites/scripts/*.es6', [ 'build:es6-client' ]);
gulp.watch([ './src/**/*.es6', '!./src/mailer-daemon/app.es6', '!./src/sites/scripts/*.es6' ], [ 'run:refresh' ]);
gulp.watch('./src/sites/**/*.scss', [ 'build:sass' ]);
gulp.watch('./src/**/*.ractive', [ 'build:views' ]);
});
gulp.task('watch:mailer', [ 'build:es6-mailer' ], function () {
gulp.watch('./src/mailer-daemon/app.es6', [ 'run:remail' ]);
});