-
Notifications
You must be signed in to change notification settings - Fork 2
/
deploy.php
48 lines (36 loc) · 947 Bytes
/
deploy.php
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
<?php
namespace Deployer;
require 'recipe/zend_framework.php';
// Project name
set('application', 'cross-cms');
// Shared files/dirs between deploys
add('shared_files', [
'.env'
]);
add('shared_dirs', [
'public/uploads'
]);
// Project repository
set('repository', 'https://github.com/cross-solution/cms.git');
set('default_stage', 'prod');
// deploy to Hosts
host('quasar.cross-solution.de')
->user('nuxt')
->stage('prod')
->multiplexing(false)
->set('deploy_path', '/srv/cms')
->set('writableusesudo', true);
// if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');
// run npm
after('deploy:symlink', 'yarn');
// restart nodeserver
after('cleanup', 'restart');
task('yarn', '
/home/nuxt/.yarn/bin/yarn;
NODE_ENV=production /home/nuxt/.yarn/bin/yarn build;
touch public/production.html;
');
task('restart', '
sudo systemctl restart nodeserver-cms.service;
');