forked from liferay/sennajs.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.js
62 lines (51 loc) · 1.64 KB
/
deploy.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
'use strict';
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
var runSequence = require('run-sequence');
var spawn = require('child_process').spawn;
gulp.task('install-bower', function (cb) {
spawn('bower', ['install'], {
stdio: 'inherit'
}).on('exit', cb);
});
gulp.task('install-npm', function (cb) {
spawn('npm', ['install'], {
cwd: 'src/public/vendor/senna',
stdio: 'inherit'
}).on('exit', cb);
});
gulp.task('run-api', function (cb) {
spawn('gulp', ['docs'], {
cwd: 'src/public/vendor/senna',
stdio: 'inherit'
}).on('exit', cb);
});
gulp.task('clean-modules', function() {
return gulp.src('src/public/vendor/senna/node_modules')
.pipe(plugins.rimraf());
});
gulp.task('copy-api', function () {
return gulp.src('src/public/vendor/senna/docs/**')
.pipe(gulp.dest('dist/public/api'));
});
gulp.task('copy-build', function () {
return gulp.src('src/public/vendor/senna/build/**')
.pipe(gulp.dest('dist/public/build'));
});
gulp.task('copy-examples', function () {
return gulp.src('src/public/vendor/senna/examples/**')
.pipe(gulp.dest('dist/public/examples'));
});
gulp.task('replace-bower', function () {
return gulp.src('dist/public/examples/**/*.html')
.pipe(plugins.replace('bower_components', 'vendor'))
.pipe(gulp.dest('dist/public/examples'));
});
gulp.task('gh-pages', function () {
return gulp.src('dist/public/**/*')
.pipe(plugins.ghPages());
});
gulp.task('deploy', ['clean'], function(cb) {
runSequence('build', 'install-bower', 'install-npm', 'run-api', 'clean-modules',
'copy-api', 'copy-build', 'copy-examples', 'replace-bower', 'gh-pages', cb);
});