author | ymh <ymh.work@gmail.com> |
Wed, 23 Nov 2016 13:48:52 +0100 | |
changeset 443 | a4e274414c3c |
parent 386 | c731ab9b934d |
child 541 | e756a8c72c3d |
permissions | -rw-r--r-- |
346
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
1 |
var gulp = require('gulp'); |
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
2 |
var elixir = require('laravel-elixir'); |
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
3 |
var del = require('del'); |
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
4 |
var seq = require('run-sequence'); |
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
5 |
var minimist = require('minimist'); |
20 | 6 |
|
7 |
var exec = require('child_process').execSync; |
|
346
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
8 |
|
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
9 |
var options = minimist(process.argv.slice(2)); |
1
01a844d292ac
dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
|
346
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
11 |
var buildOption = "--prod"; |
386
c731ab9b934d
implement first version of sparql client interface
ymh <ymh.work@gmail.com>
parents:
346
diff
changeset
|
12 |
if(options.production) { |
346
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
13 |
buildOption = "--prod"; |
386
c731ab9b934d
implement first version of sparql client interface
ymh <ymh.work@gmail.com>
parents:
346
diff
changeset
|
14 |
} else if(options.development) { |
346
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
15 |
buildOption = "--dev"; |
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
16 |
} |
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
17 |
|
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
18 |
|
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
19 |
var paths = { |
4
f55970e41793
first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
1
diff
changeset
|
20 |
'bower_base_path': './vendor/bower_components/', |
f55970e41793
first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
1
diff
changeset
|
21 |
'bootstrap': './vendor/bower_components/bootstrap-sass/assets/' |
f55970e41793
first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
1
diff
changeset
|
22 |
}; |
f55970e41793
first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
1
diff
changeset
|
23 |
|
20 | 24 |
gulp.task('build-ember', function(cb) { |
346
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
25 |
exec('node_modules/.bin/ember build '+buildOption, { |
20 | 26 |
cwd: '../bo_client', |
27 |
stdio:[0,1,2] |
|
28 |
}); |
|
29 |
}); |
|
30 |
||
31 |
gulp.task('copy-bo-ember', function() { |
|
32 |
gulp.src('../bo_client/dist/assets/*.js') |
|
33 |
.pipe(gulp.dest('public/js/vendor/')); |
|
34 |
gulp.src('../bo_client/dist/assets/*.css') |
|
28 | 35 |
.pipe(gulp.dest('public/css/')); |
36 |
gulp.src('../bo_client/dist/fonts/**/*') |
|
37 |
.pipe(gulp.dest('public/fonts/')); |
|
140 | 38 |
gulp.src('../bo_client/dist/assets/img/**/*') |
39 |
.pipe(gulp.dest('public/css/img')); |
|
40 |
||
28 | 41 |
}); |
42 |
||
346
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
43 |
gulp.task('do-copy-to-build', function() { |
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
44 |
del(['../../build/root/var/www/corpusdelaparole/corpus-back/**/*'], {force: true}, function(err, files) { |
28 | 45 |
if(err) { |
46 |
return; |
|
47 |
} |
|
346
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
48 |
gulp.src(['**/*','!vendor', '!vendor/**', '!node_modules', /*'!public/corpus-app', '!public/corpus-app/**',*/ '!node_modules/**', '!.env', '!.git*', '!bootstrap/cache/**']) |
319
78990a8a069b
Work on front and back integration, correct the expected data format
ymh <ymh.work@gmail.com>
parents:
140
diff
changeset
|
49 |
.pipe(gulp.dest('../../build/root/var/www/corpusdelaparole/corpus-back/')) |
28 | 50 |
}); |
20 | 51 |
}); |
4
f55970e41793
first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
1
diff
changeset
|
52 |
|
1
01a844d292ac
dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
53 |
elixir(function(mix) { |
4
f55970e41793
first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
1
diff
changeset
|
54 |
mix.sass('app.scss', 'public/css/app.css', {includePaths: [paths['bootstrap']+'stylesheets/']}) |
386
c731ab9b934d
implement first version of sparql client interface
ymh <ymh.work@gmail.com>
parents:
346
diff
changeset
|
55 |
.scripts(['sparqlclient.js'], 'public/js/sparqlclient.js') |
c731ab9b934d
implement first version of sparql client interface
ymh <ymh.work@gmail.com>
parents:
346
diff
changeset
|
56 |
.copy('resources/assets/sass/img', 'public/css/img') |
4
f55970e41793
first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
1
diff
changeset
|
57 |
.copy(paths.bootstrap + 'fonts/bootstrap', 'public/fonts') |
f55970e41793
first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
1
diff
changeset
|
58 |
.copy(paths.bootstrap + 'javascripts/bootstrap.js', 'public/js/vendor/bootstrap.js') |
386
c731ab9b934d
implement first version of sparql client interface
ymh <ymh.work@gmail.com>
parents:
346
diff
changeset
|
59 |
.copy(paths.bower_base_path + 'yasqe/dist/yasqe.bundled.min.js', 'public/js/vendor/yasqe.bundled.min.js') |
c731ab9b934d
implement first version of sparql client interface
ymh <ymh.work@gmail.com>
parents:
346
diff
changeset
|
60 |
.copy(paths.bower_base_path + 'yasr/dist/yasr.bundled.min.js', 'public/js/vendor/yasr.bundled.min.js') |
4
f55970e41793
first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
1
diff
changeset
|
61 |
.copy(paths.bower_base_path + 'jquery/dist/jquery.min.js', 'public/js/vendor/jquery.js') |
386
c731ab9b934d
implement first version of sparql client interface
ymh <ymh.work@gmail.com>
parents:
346
diff
changeset
|
62 |
.copy(paths.bower_base_path + 'yasqe/dist/yasqe.min.css', 'public/css/vendor/yasqe.min.css') |
c731ab9b934d
implement first version of sparql client interface
ymh <ymh.work@gmail.com>
parents:
346
diff
changeset
|
63 |
.copy(paths.bower_base_path + 'yasr/dist/yasr.min.css', 'public/css/vendor/yasr.min.css') |
20 | 64 |
.copy(paths.bower_base_path + 'font-awesome/css/font-awesome.min.css', 'public/css/vendor/font-awesome.css') |
65 |
.task('build-ember') |
|
66 |
.task('copy-bo-ember'); |
|
1
01a844d292ac
dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
67 |
}); |
346
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
68 |
|
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
69 |
gulp.task('copy-build', function(cb) { |
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
70 |
return seq('default', 'do-copy-to-build', cb); |
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
71 |
}); |
4cd0f8c936ed
upgrade build and delivery process for integration
ymh <ymh.work@gmail.com>
parents:
322
diff
changeset
|
72 |