forked from boozallen/sdp-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
30 lines (27 loc) · 819 Bytes
/
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
const {src, dest, task, series, parallel, watch, } = require('gulp');
const exec = require('child_process').exec
const browserSync = require('browser-sync').create();
const antora = require('@antora/cli')
function build(cb){
exec('make docs -e PLAYBOOK=antora-playbook-local.yml', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
if(cb instanceof Function){ cb(err) }
});
}
function serve() {
browserSync.init({
server: {
baseDir: 'docs',
},
})
watch([
"overview/**/*",
"deployment-guides/**/*",
"learning-labs/**/*",
"antora-playbook.yml"
]).on('change', build)
watch("build/**/*").on('change', browserSync.reload)
}
exports.build = build
exports.preview = series(build, serve)