-
Notifications
You must be signed in to change notification settings - Fork 3
/
Envoy.blade.php
executable file
·151 lines (131 loc) · 2.67 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
@include('ops/envoy/tasks.php')
@servers(['local' => 'localhost','staging' => $staging,'prod' => $prod])
@macro('push')
@if($env && $env == "staging")
staging_push
staging_refresh
@else
prod_push
prod_refresh
@endif
@endmacro
@macro('seed')
@if($env && $env == "staging")
staging_push
staging_seed
@else
prod_push
prod_seed
@endif
@endmacro
@macro('update')
@if($env && $env == "staging")
staging_push
staging_update
@else
prod_push
prod_update
@endif
@endmacro
@macro('ui')
@if($env && $env == "staging")
staging_ui
@else
prod_ui
@endif
@endmacro
@macro('sys')
prod_push
prod_sys
@endmacro
@macro('cmds')
@if($env && $env == "staging")
staging_push
staging_cmds
@else
prod_push
prod_cmds
@endif
@endmacro
@task('prod_push', ['on' => 'local'])
cd {{ $www }}
{{ $git_push_prod }}
@endtask
@task('staging_push', ['on' => 'local'])
cd {{ $www }}
{{ $git_push_staging }}
@endtask
@task('prod_refresh', ['on' => ['prod'], 'parallel' => true])
cd {{ $www }}
git pull origin master
{{ $refresh_env_prod }}
{{ $cache_clear }}
@endtask
@task('staging_refresh', ['on' => ['staging'], 'parallel' => true])
cd {{ $www_staging }}
git pull origin staging
{{ $refresh_env_staging }}
{{ $cache_clear }}
@endtask
@task('prod_seed', ['on' => ['prod'], 'parallel' => true])
cd {{ $www }}
git pull origin master
{{ $refresh_env_prod }}
{{ $run_migrate }}
{{ $cache_clear }}
@endtask
@task('staging_seed', ['on' => ['staging'], 'parallel' => true])
cd {{ $www_staging }}
git pull origin staging
{{ $refresh_env_staging }}
{{ $run_migrate }}
{{ $cache_clear }}
@endtask
@task('prod_update', ['on' => ['prod'], 'parallel' => true])
cd {{ $www }}
git pull origin master
{{ $clear_bootstrap_cache }}
{{ $refresh_env_prod }}
{{ $run_composer }}
{{ $run_migrate }}
bash ./bash/fix_vendor.sh
{{ $cache_clear }}
@endtask
@task('staging_update', ['on' => ['staging'], 'parallel' => true])
cd {{ $www_staging }}
git pull origin staging
{{ $clear_bootstrap_cache }}
{{ $refresh_env_staging }}
{{ $run_composer }}
{{ $run_migrate }}
{{ $cache_clear }}
@endtask
@task('prod_sys', ['on' => ['prod'], 'parallel' => true])
cd {{ $www }}
git pull origin master
{{ sync_etc($domain) }}
@endtask
@task('prod_cmds', ['on' => ['prod'], 'parallel' => true])
cd {{ $www }}
git pull origin master
{{ $run_commands }}
@endtask
@task('staging_cmds', ['on' => ['staging'], 'parallel' => true])
cd {{ $www_staging }}
git pull origin staging
{{ $run_commands }}
@endtask
@task('prod_ui', ['on' => 'local'])
cd {{ $www }}
git pull origin master
@if ($build)
npm run prod
@endif
{{ copy_ui($prod, $domain) }}
@endtask
@task('staging_ui', ['on' => 'local'])
@if ($build)
npm run prod
@endif
{{ copy_ui($staging, $domain, "staging") }}
@endtask