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);
|
|
|
|
|
2020-02-28 09:15:21 -08:00
|
|
|
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}',
|
2020-02-28 09:15:21 -08:00
|
|
|
'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);
|