forked from yllumi/heroicadmin
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.php
More file actions
50 lines (37 loc) · 1.24 KB
/
deploy.php
File metadata and controls
50 lines (37 loc) · 1.24 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
<?php
namespace Deployer;
require 'recipe/codeigniter4.php';
// Config
set('repository', 'git@github.com:codepolitanlab/ruangai.git');
add('shared_files', ['Caddyfile','php.ini']);
add('shared_dirs', ['public/certificates']);
add('writable_dirs', []);
// Hosts
// Production
host('main')
->setHostname('ruangai-staging.appdata.id')
->setRemoteUser('root')
->setDeployPath('/var/www/ruangai.codepolitan.com')
->set('branch', 'main');
// Staging
host('dev')
->setHostname('ruangai-staging.appdata.id')
->setRemoteUser('root')
->setDeployPath('/var/www/ruangai-staging.appdata.id')
->set('branch', 'dev');
// Custom Tasks
desc('Update heroic settings');
task('spark:heroic:update', function () {
run('{{bin/php}} {{release_path}}/spark heroic:update');
});
/**
* Hooks: Mengatur urutan task tanpa merusak flow asli CI4 recipe
*/
// Jalankan migrasi setelah vendor terinstall
after('deploy:vendors', 'spark:migrate');
// Jalankan update heroic setelah migrasi selesai
after('spark:migrate', 'spark:heroic:update');
// Pastikan symlink diperbarui dan cache dioptimasi di akhir
after('deploy:publish', 'spark:optimize');
// Unlock jika gagal agar tidak nyangkut saat deploy berikutnya
after('deploy:failed', 'deploy:unlock');