-
Notifications
You must be signed in to change notification settings - Fork 2
/
deploy.php
41 lines (29 loc) · 862 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
<?php
namespace Deployer;
require 'recipe/laravel.php';
// Config
set('repository', '[email protected]:rizkyilhampra/spdhtc.git');
// it will be override by laravel recipe. See https://deployer.org/docs/7.x/recipe/laravel
add('shared_files', []);
add('shared_dirs', []);
add('writable_dirs', []);
// Hosts
host('spdhtc.rizkyilhampra.me')
->set('hostname', getenv('HOSTNAME'))
->set('remote_user', getenv('REMOTE_USER'))
->set('deploy_path', getenv('DEPLOY_PATH'));
// Tasks
task('deploy:secrets', function () {
file_put_contents(__DIR__.'/.env', getenv('DOT_ENV'));
upload('.env', get('deploy_path').'/shared');
});
task('deploy', [
'deploy:prepare',
'deploy:secrets',
'deploy:vendors',
'artisan:storage:link',
'artisan:optimize:clear',
'deploy:publish',
]);
// Hooks
after('deploy:failed', 'deploy:unlock');