forked from roots/bedrock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.php
79 lines (68 loc) · 1.66 KB
/
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
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
77
78
79
<?php
/**
* - Deploy with `php vendor/bin/dep deploy stage`
* - Set Webspace Path to 'current/web'
*/
namespace Deployer;
// Configurate Hostname of stage & production
$hostname = 'moritz-graf.de';
$stage_hostname = $hostname;
// get directory of projects. Will be used for domain name,...
set( 'local_root', dirname( __FILE__ ) );
require 'vendor/mmoollllee/bedrock-deployer-7/config/config.php';
// set
host( 'stage' )
->setHostname( $stage_hostname )
->set('remote_user', function () { return getenv('STAGE_USERNAME') ?: getenv('USERNAME'); })
->set('deploy_path', function () { return getenv('STAGE_DIR'); });
host( 'prod' )
->setHostname( $hostname )
->set('remote_user', function () { return getenv('USERNAME'); })
->set('deploy_path', function () { return getenv('DIR'); });
// Tasks
desc( 'Deploy whole project' );
task( 'deploy', [
'deployer:check',
'bedrock:prepare',
'deploy:lock',
'deploy:release',
'deploy:update_code',
'trellis:remove',
'deploy:shared',
'deploy:writable',
'deploy:symlink',
'bedrock:env',
'bedrock:acf',
'bedrock:vendors',
'deploy:clear_paths',
'push:db',
'push:files-no-bak',
'deploy:unlock',
'deploy:cleanup',
'deploy:success',
] );
desc( 'Deploy only app' );
task( 'update', [
'deployer:check',
'bedrock:prepare',
'deploy:lock',
'deploy:release',
'deploy:update_code',
'trellis:remove',
'deploy:shared',
'deploy:writable',
'bedrock:env',
'bedrock:acf',
'bedrock:vendors',
'deploy:clear_paths',
'deploy:symlink',
'deploy:unlock',
'deploy:cleanup',
'deploy:success',
] );
task( 'pull', [
'pull:db',
'pull:files',
] );
// [Optional] if deploy fails automatically unlock.
after( 'deploy:failed', 'deploy:unlock' );