-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
deploy.php
38 lines (27 loc) · 894 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
<?php
namespace Deployer;
require 'recipe/zend_framework.php';
require 'contrib/php-fpm.php';
// Config
set('repository', 'https://github.com/jbelien/MapFile-Generator');
add('shared_files', []);
add('shared_dirs', []);
add('writable_dirs', []);
// Hosts
host('mapfile.akoo.be')
->set('remote_user', 'root')
->set('deploy_path', '/var/www/mapfile');
// Tasks
task('npm:build', function () {
runLocally('npm install');
runLocally('npm run build');
});
task('npm:rsync', function () {
runLocally('rsync -e ssh -az public/css/ {{remote_user}}@{{hostname}}:{{release_path}}/public/css/');
runLocally('rsync -e ssh -az public/js/ {{remote_user}}@{{hostname}}:{{release_path}}/public/js/');
});
task('npm', ['npm:build', 'npm:rsync']);
// Hooks
after('deploy:update_code', 'npm');
after('deploy:failed', 'deploy:unlock');
after('deploy:success', 'php-fpm:reload');