-
Notifications
You must be signed in to change notification settings - Fork 71
/
gulpfile.js
68 lines (62 loc) · 1.75 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
var gulp = require('gulp');
var webserver = require('gulp-webserver');
var del = require('del');
var requireDir = require('require-dir');
var tasks = requireDir('./tasks');
// Clean dist directory
gulp.task('clean-dist', function () {
return del(['dist/*', 'tmp/*']);
});
// Watch if markdown, less, html or image files have changed
// so as to relaunch the build into dist directory
// Should be used for dev purpose
gulp.task('watch', ['create-dist'], function() {
gulp.watch('content/**/*.md', ['create-dist']);
gulp.watch('content/img/**/*', ['create-dist']);
gulp.watch('content/swagger/**/*.yaml', ['create-dist']);
gulp.watch('content/beta/**/*.yaml', ['create-dist']);
gulp.watch('styles/**/*.less', ['create-dist']);
gulp.watch('src/**/*.handlebars', ['create-dist']);
});
// Launch a server with dist directory exposed on it
// Should be used for dev purpose
gulp.task('launch-webserver', ['create-dist'], function() {
return gulp.src('dist')
.pipe(webserver({
host: '0.0.0.0',
livereload: true,
directoryListing: false,
open: true
}));
});
// Build the documentation is dist directory
gulp.task('create-dist', [
'clean-dist',
'less',
'copy-assets',
'reference',
'landings',
'build-concepts',
'build-rest-api',
'build-graphql',
'build-supplier-data-manager',
'build-event-platform',
'build-events-api',
'build-php-client',
'build-misc-documentation',
'build-guides',
'build-getting-started',
'build-events-reference-page',
'build-app-developer-tools',
'build-apps',
'build-app-portal',
'build-tutorials-homepage',
'build-tutorials',
'build-news',
'build-redirections',
]);
// Main task that should be used for development purpose
gulp.task('serve', [
'launch-webserver',
'watch'
]);