-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.php
64 lines (50 loc) · 1.32 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
<?php
namespace Deployer;
require 'recipe/laravel.php';
require 'contrib/npm.php';
require 'contrib/rsync.php';
// Config
set('repository', 'https://github.com/billalxcode/stemdja-master-app.git');
set('ssh_multiplexing', true);
add('shared_files', []);
add('shared_dirs', []);
add('writable_dirs', []);
set("rsync_src", function () {
return __DIR__;
});
add("rsync", [
"exclude" => [
"git",
"/vendor/",
"/node_modules/",
".github",
"deploy.php"
]
]);
// Hosts
host('54.251.66.29')
->set('remote_user', 'deployer')
->set('deploy_path', '~/$PWD')
->set('branch', 'main');
// Tasks
task("deploy:secrets", function () {
file_put_contents(__DIR__ . "/.env", getenv("DOT_ENV"));
upload(".env", get("deploy_path") ."/shared");
});
desc('Start of Deploy the application');
task('deploy', [
'deploy:prepare',
'rsync', // Deploy code & built assets
'deploy:secrets', // Deploy secrets
'deploy:vendors',
'deploy:shared', //
'artisan:storage:link', //
'artisan:view:cache', //
'artisan:config:cache', // Laravel specific steps
'artisan:migrate', //
'artisan:queue:restart',//
'deploy:publish', //
]);
desc('End of Deploy the application');
// Hooks
after('deploy:failed', 'deploy:unlock');