-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathshipitfile.js
76 lines (66 loc) · 2.21 KB
/
shipitfile.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
module.exports = function (shipit) {
require('shipit-deploy')(shipit);
require('shipit-shared')(shipit);
shipit.initConfig({
default: {
workspace: '/tmp/cheerup',
repositoryUrl: '[email protected]:harijoe/cheerup.git',
ignores: ['.git', 'node_modules'],
keepReleases: 3,
shallowClone: true,
shared: {
overwrite: true,
dirs: [
'vendor',
'bower_components',
'node_modules',
'var'
],
files: [
'app/config/parameters.yml'
]
}
},
prod: {
servers: '[email protected]',
branch: 'master',
deployTo: '/var/www/cheerup'
}
});
var composerInstall = function () {
return shipit.remote("cd " + shipit.releasePath + " && composer install");
};
var clearCache = function () {
return shipit.remote("cd " + shipit.releasePath + " && php bin/console cache:clear --env=prod");
};
var migrate = function () {
return shipit.remote("cd " + shipit.releasePath + " && php bin/console doctrine:schema:update --force");
};
var npmInstall = function () {
return shipit.remote("cd " + shipit.releasePath + " && npm install");
};
var bowerInstall = function () {
return shipit.remote("cd " + shipit.releasePath + " && ./node_modules/.bin/bower install");
};
var gulpBuild = function () {
return shipit.remote("cd " + shipit.releasePath + " && ./node_modules/.bin/gulp build");
};
var fpmRestart = function() {
return shipit.remote("sudo service php5-fpm restart");
};
shipit.on('shared:link:files', function() {
return shipit.start('install');
});
shipit.blTask('install', function() {
return composerInstall()
.then(clearCache)
.then(migrate)
.then(npmInstall)
//.then(bowerInstall)
.then(gulpBuild)
.then(fpmRestart)
.then(function () {
shipit.log('Install Done!');
});
});
};