2020-02-20 14:38:25 -08:00
|
|
|
|
2020-02-28 10:27:52 -08:00
|
|
|
const { series, watch } = require('gulp');
|
2020-02-20 14:38:25 -08:00
|
|
|
|
|
|
|
/** **************************************************************************************************************** **/
|
|
|
|
|
2020-02-28 10:33:39 -08:00
|
|
|
var build = require('../build');
|
2020-02-20 14:38:25 -08:00
|
|
|
|
2020-02-28 10:33:39 -08:00
|
|
|
const devBuildTask = build.everything();
|
|
|
|
const prodBuildTask = build.everything(true);
|
2020-02-20 14:38:25 -08:00
|
|
|
|
|
|
|
var cleanTask = require('./clean');
|
|
|
|
exports.clean = cleanTask;
|
|
|
|
|
|
|
|
const pushToProd = require('./publish');
|
|
|
|
exports.push = pushToProd;
|
|
|
|
|
|
|
|
const cloudfront = require('./cloudfront');
|
|
|
|
exports.cloudfront = cloudfront;
|
|
|
|
|
2020-02-29 16:28:11 -08:00
|
|
|
exports.new = require('../build/new-post.js');
|
|
|
|
|
2020-02-20 14:38:25 -08:00
|
|
|
/** **************************************************************************************************************** **/
|
|
|
|
|
2020-02-28 10:27:52 -08:00
|
|
|
exports.dev = series(devBuildTask);
|
|
|
|
exports.prod = series(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-28 10:27:52 -08:00
|
|
|
'js/*.js',
|
|
|
|
], devBuildTask);
|
2020-02-20 14:38:25 -08:00
|
|
|
|
2020-02-28 10:27:52 -08:00
|
|
|
server();
|
2020-02-20 14:38:25 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
function server () {
|
|
|
|
var forever = require('forever');
|
|
|
|
var srv = new forever.Monitor('server.js');
|
|
|
|
srv.start();
|
|
|
|
forever.startServer(srv);
|
|
|
|
}
|
|
|
|
|
2020-02-28 10:27:52 -08:00
|
|
|
exports.watch = series(devBuildTask, 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);
|