-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathEnvoy.blade.php
44 lines (38 loc) · 1.08 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
@servers(['web' => 'dengue-deploy'])
<?php
$repo = '[email protected]:caiquecastro/hotel-manager.git';
$release_dir = '/var/www/HotelManager/releases';
$app_dir = '/var/www/HotelManager/current';
$release = 'release_' . date('YmdHis');
?>
@macro('deploy', ['on' => 'web'])
fetch_repo
run_composer
update_permissions
update_symlinks
@endmacro
@task('fetch_repo')
echo 'Fetching repository';
[ -d {{ $release_dir }} ] || mkdir -p {{ $release_dir }};
cd {{ $release_dir }};
git clone {{ $repo }} {{ $release }}
@endtask
@task('run_composer')
echo 'Running composer';
cd {{ $release_dir }}/{{ $release }};
composer install --prefer-dist;
php artisan key:generate;
npm install;
gulp;
@endtask
@task('update_permissions')
echo 'Updating permissions';
cd {{ $release_dir }};
sudo chown -R ubuntu:www-data {{ $release }};
sudo chmod -R ug+rwx {{ $release }};
@endtask
@task('update_symlinks')
echo 'Updating symlinks';
ln -nfs {{ $release_dir }}/{{ $release }} {{ $app_dir }}
sudo chown -h ubuntu:www-data {{ $app_dir }};
@endtask