-
Notifications
You must be signed in to change notification settings - Fork 58
/
Envoy.blade.php
51 lines (42 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
45
46
47
48
49
50
51
@servers(['local' => '127.0.0.1', 'prod' => 'bdgt'])
@setup
$env ??= 'local';
$root = [
'local' => '.',
'prod' => '/var/www/bdgt',
][$env];
function output($message) {
return "echo '\033[32m" . $message . "\033[0m';";
}
@endsetup
@story('setup')
composer
database
@endstory
@story('deploy')
git
composer
artisan
@endstory
@task('git', ['on' => $env])
{{ output('🌀 Updating code...') }}
cd {{ $root }}
git pull
@endtask
@task('composer', ['on' => $env])
{{ output('🚚 Installing dependencies...') }}
cd {{ $root }}
composer install --no-interaction --prefer-dist {{ $env === 'prod' ? ' --optimize-autoloader --no-dev' : '' }}
@endtask
@task('database', ['on' => 'local'])
{{ output('🔨 Migrating and seeding the DB...') }}
php artisan migrate --seed
@endtask
@task('artisan', ['on' => 'prod'])
{{ output('✨ Migrating and optimizing...') }}
cd {{ $root }}
php artisan migrate --force
php artisan config:cache
php artisan route:trans:cache
php artisan view:cache
@endtask