-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
46 lines (41 loc) · 1.18 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
var gulp = require('gulp');
var shell = require('gulp-shell');
gulp.task('default', shell.task([
'echo',
'echo COMMANDS LIST :',
'echo - build : Prepare the project to be pushed on the server',
'echo - push : Push the project on the server',
'echo - deploy : Build then push the project on the server',
'echo'
]));
gulp.task('build', shell.task([
'echo',
'echo Building the project into ./dist ...',
'echo',
'rsync -avz --progress --exclude-from "exclude-list-gulp.txt" ./ dist/',
'echo',
'echo Building finished',
'echo'
]));
gulp.task('push', shell.task([
'echo',
'echo Deploying the project on the server ...',
'echo',
'scp -r dist/* [email protected]:/var/www/html/alexa-parkinson',
'ssh -t [email protected] "cd /var/www/html/alexa-parkinson && sudo docker-compose down && sudo docker-compose up -d"',
'echo',
'echo Push finished',
'echo',
]));
gulp.task('deploy', ['build'], function() {
gulp.run('push');
shell.task([
'echo',
'echo Deleting the build file',
'echo',
'rm -rf dist/',
'echo',
'echo Deployment finished',
'echo',
]);
});