-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.php
More file actions
56 lines (41 loc) · 1.31 KB
/
deploy.php
File metadata and controls
56 lines (41 loc) · 1.31 KB
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
<?php
namespace Deployer;
require 'recipe/common.php';
set('keep_releases', 4);
// Start editable
set('repository', 'git@github.com:transitionnetwork/CDS.git');
set('ssh_type', 'native');
set('ssh_multiplexing', true);
// End editable
// Do not modify anything under this line unless you know what you're doing
import('hosts.yml');
task('deploy:gulp', function() {
$do_gulp = askConfirmation('Run Gulp?', false);
if( $do_gulp ) { runLocally('gulp --production'); }
})->desc('Create dist folder');
task('deploy:upload_dist', function() {
upload('dist', '{{release_path}}');
})->desc('Upload dist folder to server');
task('deploy:theme_composer', function() {
cd('{{release_path}}');
// run('composer install');
run('~/composer.phar install');
})->desc('Remote composer install');
task('deploy:cache_flush', function () {
run('wp --path=public_html cache flush || true');
run('wp --path=public_html litespeed-purge all || true');
})->desc('Flush WP object cache and LiteSpeed page cache');
task('deploy', [
'deploy:setup',
'deploy:lock',
'deploy:gulp',
'deploy:release',
'deploy:update_code',
'deploy:upload_dist',
'deploy:theme_composer',
'deploy:symlink',
'deploy:cache_flush',
'deploy:unlock',
'deploy:cleanup',
])->desc('Executing Deploy task');
after('deploy:failed', 'deploy:unlock');