forked from benjaminkott/packagebuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.php
52 lines (43 loc) · 1.26 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
<?php
/*
* This file is part of the bk2k/packagebuilder.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace Deployer;
require 'recipe/common.php';
// Configuration
set('application', getenv('DEPLOYER_APPLICATION'));
set('repository', 'https://github.com/benjaminkott/packagebuilder.git');
set('ssh_type', 'native');
set('keep_releases', '3');
set('allow_anonymous_stats', false);
// Shared files/dirs between deploys
add('shared_files', ['.env']);
add('shared_dirs', []);
// Writable dirs by web server
set('allow_anonymous_stats', false);
// Hosts
host(getenv('DEPLOYER_HOST'))
->user(getenv('DEPLOYER_USER'))
->port('22')
->set('bin/php', getenv('DEPLOYER_PHP'))
->set('bin/composer', getenv('DEPLOYER_COMPOSER'))
->set('deploy_path', '~/html/application/{{application}}');
// Tasks
task('deploy', [
'deploy:info',
'deploy:prepare',
'deploy:lock',
'deploy:release',
'deploy:update_code',
'deploy:shared',
'deploy:vendors',
'deploy:symlink',
'deploy:unlock',
'cleanup',
])->desc('Deploy your project');
after('deploy', 'success');
// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');