-
Notifications
You must be signed in to change notification settings - Fork 1
/
Envoy.blade.php
59 lines (44 loc) · 1.25 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
@servers(['server' => 'do','local' =>'127.0.0.1'])
{{-- story for run, only run story for server --}}
@story('deploy')
push
update-code
install-dependencies
migrate
rebuild-cache
@endstory
@story('update')
push
update-code
@endstory('update')
{{-- command for server --}}
@task('update-code',[ 'on' => 'server'])
cd /data/wwwroot/alpha.linux.cn
git add .
git checkout -f
git pull
chown -R www.www /data/wwwroot/alpha.linux.cn
@endtask
@task('install-dependencies',[ 'on' => 'server'])
cd /data/wwwroot/alpha.linux.cn
sudo -u www /usr/local/php/bin/php /usr/local/bin/composer install --prefer-dist --no-dev -o
npm install
npm run build
chown -R www.www /data/wwwroot/alpha.linux.cn/public
chown -R www.www /data/wwwroot/alpha.linux.cn/vendor
@endtask
@task('rebuild-cache',[ 'on' => 'server'])
cd /data/wwwroot/alpha.linux.cn
sudo -u www /usr/local/php/bin/php artisan cache:clear
sudo -u www /usr/local/php/bin/php artisan view:clear
sudo -u www /usr/local/php/bin/php artisan optimize
sudo -u www /usr/local/php/bin/php artisan view:cache
@endtask
@task('migrate',[ 'on' => 'server'])
cd /data/wwwroot/alpha.linux.cn
sudo -u www /usr/local/php/bin/php artisan migrate --force
@endtask
{{-- command for local --}}
@task('push',['on' => 'local' ])
git push
@endtask