-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
85 lines (72 loc) · 1.99 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
'use strict';
const gulp = require('gulp');
const gat = require('gulp-all-tasks')();
const exec = require('child_process').exec;
//const exec = require('gulp-exec');
const opn = require('opn');
const config = {
repo: 'https://github.com/luminous-software/luminous-code.git',
remote: 'github',
branch: 'master',
folder: 'site',
push: 'false',
force: 'false',
//commit: 'Automatic commit text',
user: {
email: 'yd@live.com.au',
name: 'Yann Duran'
},
address: '127.0.0.1',
port: '8003'
};
const consts = {
address: config.address + ':' + config.port
};
const options = {
pretty_format: ' --pretty=format:" * %s"'
};
const script = {
generate: 'mkdocs build',
serve: 'mkdocs serve --dev-addr=' + consts.address,
log: 'git log HEAD' + options.pretty_format,
changes: 'git log -n 1 HEAD' + options.pretty_format,
features: 'echo. && git log HEAD --grep="^feat" --no-merges' + options.pretty_format
};
gulp.task('log', function (cb) {
exec(script.log, function (err, stdout, stderr) {
gulp_util.log(stdout);
gulp_util.log(stderr);
cb(err);
});
});
gulp.task('changes', function (cb) {
exec(script.changes, function (err, stdout, stderr) {
gulp_util.log(stdout);
gulp_util.log(stderr);
cb(err);
});
});
gulp.task('features', function (cb) {
exec(script.features, function (err, stdout, stderr) {
gulp_util.log(stdout);
gulp_util.log(stderr);
cb(err);
});
});
gulp.task('generate', function (cb) {
exec(script.generate, function (err, stdout, stderr) {
gulp_util.log(stdout);
gulp_util.log(stderr);
cb(err);
});
});
gulp.task('serve', function (cb) {
gulp_util.log(consts.address);
exec(script.serve, function (err, stdout, stderr) {
gulp_util.log(stdout);
gulp_util.log(stderr);
cb(err);
});
opn('http://' + consts.address);
});
//gulp.task('default', ['build', 'deploy']);