-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathEnvoy.blade.php
80 lines (67 loc) · 1.81 KB
/
Envoy.blade.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
80
@setup
$repository = '[email protected]:francoism90/hub.git';
$branch = 'main';
$remote = 'foxws';
$remotePath = '/home/foxws/hub';
@endsetup
@servers(['remote' => $remote])
@story('deploy')
maintenance-mode
update-repository
install-dependencies
generate-assets
update-application
optimize-application
finish-deploy
@endstory
@story('deploy-build')
maintenance-mode
update-repository
build-containers
finish-deploy
@endstory
@task('maintenance-mode', ['on' => 'remote'])
podman exec -it systemd-hub-app php artisan down --with-secret
@endtask
@task('install-dependencies', ['on' => 'remote'])
podman exec -it systemd-hub-app sh -c "
composer install --prefer-dist --no-scripts -q -o &&
yarn install;
";
@endtask
@task('generate-assets', ['on' => 'remote'])
podman exec -it systemd-hub-app sh -c "
yarn run build;
";
@endtask
@task('finish-deploy', ['on' => 'remote'])
podman exec -it systemd-hub-app sh -c "
php artisan up;
";
@endtask
@task('update-application', ['on' => 'remote'])
podman exec -it systemd-hub-app sh -c "
php artisan app:update;
";
@endtask
@task('optimize-application', ['on' => 'remote'])
podman exec -it systemd-hub-app sh -c "
php artisan app:optimize;
";
@endtask
@task('setup-environment', ['on' => 'remote'])
mkdir -p {{ $remotePath }}
git clone --depth 1 {{ $repository }} {{ $remotePath }}
@endtask
@task('update-repository', ['on' => 'remote'])
cd {{ $remotePath }}
git pull origin {{ $branch }}
@endtask
@task('build-containers', ['on' => 'remote'])
cd {{ $remotePath }}
./docs/podman/make
@endtask
@task('restart-containers', ['on' => 'remote'])
systemctl --user daemon-reload
systemctl --user restart hub-app hub
@endtask