80 lines
1.8 KiB
JavaScript
Raw Normal View History

2020-02-20 14:38:25 -08:00
const { series, parallel, watch } = require('gulp');
/** **************************************************************************************************************** **/
2020-02-21 20:05:52 -08:00
var content = require('./content');
2020-02-20 14:38:25 -08:00
2020-02-25 19:37:10 -08:00
const everything = content.everything();
everything.prod = content.everything(true);
exports.go = series(everything);
2020-02-20 14:38:25 -08:00
var jsTask = require('./scripts');
exports.js = jsTask;
var cleanTask = require('./clean');
exports.clean = cleanTask;
const pushToProd = require('./publish');
exports.push = pushToProd;
const cloudfront = require('./cloudfront');
exports.cloudfront = cloudfront;
/** **************************************************************************************************************** **/
2020-02-25 19:37:10 -08:00
var prodBuildTask = parallel(
2020-02-20 14:38:25 -08:00
jsTask.prod,
2020-02-25 19:37:10 -08:00
everything.prod,
2020-02-20 14:38:25 -08:00
);
2020-02-25 19:37:10 -08:00
var devBuildTask = parallel(
jsTask,
everything,
2020-02-20 14:38:25 -08:00
);
2020-02-25 19:37:10 -08:00
exports.dev = devBuildTask;
2020-02-21 20:05:52 -08:00
exports.prod = prodBuildTask;
2020-02-20 14:38:25 -08:00
exports.publish = series(
cleanTask,
2020-02-21 20:05:52 -08:00
prodBuildTask,
2020-02-20 14:38:25 -08:00
pushToProd,
cloudfront.prod,
);
exports.testpush = pushToProd.dryrun;
/** **************************************************************************************************************** **/
function watcher () {
watch([
2020-02-27 18:57:39 -08:00
'public/**/*',
2020-02-20 14:38:25 -08:00
'templates/*.{md,hbs,html}',
'scss/*.scss',
2020-02-27 18:57:39 -08:00
], everything);
2020-02-20 14:38:25 -08:00
watch('js/*.js', jsTask);
var forever = require('forever');
var srv = new forever.Monitor('server.js');
srv.start();
forever.startServer(srv);
}
function server () {
var forever = require('forever');
var srv = new forever.Monitor('server.js');
srv.start();
forever.startServer(srv);
}
2020-02-27 18:57:39 -08:00
exports.watch = series(everything, watcher);
2020-02-21 20:05:52 -08:00
exports.uat = series(cleanTask, prodBuildTask, server);
2020-02-20 14:38:25 -08:00
/** **************************************************************************************************************** **/
exports.default = series(cleanTask.dev, devBuildTask, watcher);