forked from ji-devs/ji-cloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.toml
250 lines (191 loc) · 9.28 KB
/
Makefile.toml
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
###################
## Config ##
###################
[config]
skip_core_tasks = true
[env]
DOCKER_BUILDKIT = "1"
###################
## Gcloud ##
###################
[tasks.gcloud-configure-docker]
script_runner = "@shell"
script = ["gcloud auth configure-docker"]
###################
## PAGES ##
###################
#------Release-----------#
[tasks.release-pages]
run_task = [{name = [
"gcloud-configure-docker",
"docker-build-release-pages",
"docker-publish-release-pages",
"deploy-release-pages",
]}]
[tasks.docker-build-release-pages]
command = "docker"
args = ["build", "-f", "backend/pages/Dockerfile", "--target", "release", "-t", "gcr.io/ji-cloud/ji-cloud-pages:latest", "."]
[tasks.docker-publish-release-pages]
command = "docker"
args = ["push", "gcr.io/ji-cloud/ji-cloud-pages:latest"]
[tasks.deploy-release-pages]
script_runner = "@shell"
script = ["gcloud run deploy ji-cloud-pages --project ji-cloud --region europe-west1 --image gcr.io/ji-cloud/ji-cloud-pages:latest --platform managed"]
#------Sandbox-----------#
[tasks.sandbox-pages]
run_task = [{name = [
"gcloud-configure-docker",
"docker-build-sandbox-pages",
"docker-publish-sandbox-pages",
"deploy-sandbox-pages",
]}]
[tasks.docker-build-sandbox-pages]
command = "docker"
args = ["build", "-f", "backend/pages/Dockerfile", "--target", "sandbox", "-t", "gcr.io/ji-cloud-developer-sandbox/ji-cloud-pages-sandbox:latest", "."]
[tasks.docker-publish-sandbox-pages]
command = "docker"
args = ["push", "gcr.io/ji-cloud-developer-sandbox/ji-cloud-pages-sandbox:latest"]
[tasks.deploy-sandbox-pages]
script_runner = "@shell"
script = ["gcloud run deploy ji-cloud-pages-sandbox --project ji-cloud-developer-sandbox --region europe-west1 --image gcr.io/ji-cloud-developer-sandbox/ji-cloud-pages-sandbox:latest --platform managed"]
###################
## API ##
###################
#------Release-----------#
[tasks.release-api]
run_task = [{name = [
"gcloud-configure-docker",
"docker-build-release-api",
"docker-publish-release-api",
"deploy-release-api",
]}]
[tasks.docker-build-release-api]
command = "docker"
args = ["build", "-f", "backend/api/Dockerfile", "--target", "release", "-t", "gcr.io/ji-cloud/ji-cloud-api:latest", "."]
[tasks.docker-publish-release-api]
command = "docker"
args = ["push", "gcr.io/ji-cloud/ji-cloud-api:latest"]
[tasks.deploy-release-api]
script_runner = "@shell"
script = ["gcloud run deploy ji-cloud-api --project ji-cloud --region europe-west1 --image gcr.io/ji-cloud/ji-cloud-api:latest --platform managed"]
#------Sandbox-----------#
[tasks.sandbox-api]
run_task = [{name = [
"gcloud-configure-docker",
"docker-build-sandbox-api",
"docker-publish-sandbox-api",
"deploy-sandbox-api",
]}]
[tasks.docker-build-sandbox-api]
command = "docker"
args = ["build", "-f", "backend/api/Dockerfile", "--target", "sandbox", "-t", "gcr.io/ji-cloud-developer-sandbox/ji-cloud-api-sandbox:latest", "."]
[tasks.docker-publish-sandbox-api]
command = "docker"
args = ["push", "gcr.io/ji-cloud-developer-sandbox/ji-cloud-api-sandbox:latest"]
[tasks.deploy-sandbox-api]
script_runner = "@shell"
script = ["gcloud run deploy ji-cloud-api-sandbox --project ji-cloud-developer-sandbox --region europe-west1 --image gcr.io/ji-cloud-developer-sandbox/ji-cloud-api-sandbox:latest --platform managed"]
#####################
## API MEDIA WATCH ##
#####################
#------Release-----------#
[tasks.release-api-media-watch]
run_task = [{name = [
"gcloud-configure-docker",
"docker-build-release-api-media-watch",
"docker-publish-release-api-media-watch",
"deploy-release-api-media-watch",
]}]
[tasks.docker-build-release-api-media-watch]
command = "docker"
args = ["build", "-f", "backend/api/Dockerfile", "--target", "release_media_watch", "-t", "gcr.io/ji-cloud/ji-cloud-api-media-watch:latest", "."]
[tasks.docker-publish-release-api-media-watch]
command = "docker"
args = ["push", "gcr.io/ji-cloud/ji-cloud-api-media-watch:latest"]
[tasks.deploy-release-api-media-watch]
script_runner = "@shell"
script = ["gcloud run deploy ji-cloud-api-media-watch --project ji-cloud --region europe-west1 --image gcr.io/ji-cloud/ji-cloud-api-media-watch:latest --platform managed"]
#------Sandbox-----------#
[tasks.sandbox-api-media-watch]
run_task = [{name = [
"gcloud-configure-docker",
"docker-build-sandbox-api-media-watch",
"docker-publish-sandbox-api-media-watch",
"deploy-sandbox-api-media-watch",
]}]
[tasks.docker-build-sandbox-api-media-watch]
command = "docker"
args = ["build", "-f", "backend/api/Dockerfile", "--target", "sandbox_media_watch", "-t", "gcr.io/ji-cloud-developer-sandbox/ji-cloud-api-media-watch-sandbox:latest", "."]
[tasks.docker-publish-sandbox-api-media-watch]
command = "docker"
args = ["push", "gcr.io/ji-cloud-developer-sandbox/ji-cloud-api-media-watch-sandbox:latest"]
[tasks.deploy-sandbox-api-media-watch]
script_runner = "@shell"
script = ["gcloud run deploy ji-cloud-api-media-watch-sandbox --project ji-cloud-developer-sandbox --region europe-west1 --image gcr.io/ji-cloud-developer-sandbox/ji-cloud-api-media-watch-sandbox:latest --platform managed"]
###################
## Fastly Purge ##
###################
#------Release-----------#
[tasks.release-fastly-purge]
run_task = [{name = [
"deploy-release-fastly-purge-frontend",
"deploy-release-fastly-purge-uploads",
"deploy-release-fastly-purge-media",
]}]
[tasks.deploy-release-fastly-purge-frontend]
script_runner = "@shell"
script = ["gcloud functions deploy purgeFrontendRelease --project ji-cloud --trigger-resource ji-cloud-frontend-origin-eu-001 --region europe-west1 --source backend/fastly-purge --runtime nodejs10 --trigger-event google.storage.object.finalize"]
[tasks.deploy-release-fastly-purge-uploads]
script_runner = "@shell"
script = ["gcloud functions deploy purgeUploadsRelease --project ji-cloud --trigger-resource ji-cloud-uploads-origin-eu-001 --region europe-west1 --source backend/fastly-purge --runtime nodejs10 --trigger-event google.storage.object.finalize"]
# the media is on release project since it's used by release project (media.jicloud.org)
[tasks.deploy-release-fastly-purge-media]
script_runner = "@shell"
script = ["gcloud functions deploy purgeMedia --project ji-cloud --trigger-resource ji-cloud-media-origin-eu-001 --region europe-west1 --source backend/fastly-purge --runtime nodejs10 --trigger-event google.storage.object.finalize"]
#------Sandbox-----------#
[tasks.sandbox-fastly-purge]
run_task = [{name = [
"deploy-sandbox-fastly-purge-frontend",
"deploy-sandbox-fastly-purge-uploads",
]}]
[tasks.deploy-sandbox-fastly-purge-frontend]
script_runner = "@shell"
script = ["gcloud functions deploy purgeFrontendSandbox --project ji-cloud-developer-sandbox --trigger-resource ji-cloud-sandbox-frontend-origin-eu-001 --region europe-west1 --source backend/fastly-purge --runtime nodejs14 --trigger-event google.storage.object.finalize"]
[tasks.deploy-sandbox-fastly-purge-uploads]
script_runner = "@shell"
script = ["gcloud functions deploy purgeUploadsSandbox --project ji-cloud-developer-sandbox --trigger-resource ji-cloud-sandbox-uploads-origin-eu-001 --region europe-west1 --source backend/fastly-purge --runtime nodejs14 --trigger-event google.storage.object.finalize"]
###################
## Screenshot ##
###################
#------Release-----------#
[tasks.release-screenshot]
run_task = [{name = [
"deploy-release-screenshot-save",
"deploy-release-screenshot-show",
"deploy-release-screenshot-queue",
]}]
[tasks.deploy-release-screenshot-save]
script_runner = "@shell"
script = ["gcloud functions deploy saveScreenshotRelease --trigger-http --project=ji-cloud --region=europe-west1 --source backend/screenshot --allow-unauthenticated --memory=1024MB --runtime=nodejs10 --timeout=540s"]
[tasks.deploy-release-screenshot-show]
script_runner = "@shell"
script = ["gcloud functions deploy showScreenshotRelease --trigger-http --project=ji-cloud --region=europe-west1 --source backend/screenshot --allow-unauthenticated --memory=1024MB --runtime=nodejs10 --timeout=540s"]
[tasks.deploy-release-screenshot-queue]
script_runner = "@shell"
script = ["gcloud functions deploy queueScreenshotRelease --trigger-http --project=ji-cloud --region=europe-west1 --source backend/screenshot --allow-unauthenticated --runtime=nodejs10"]
#------Sandbox-----------#
[tasks.sandbox-screenshot]
run_task = [{name = [
"deploy-sandbox-screenshot-save",
"deploy-sandbox-screenshot-show",
"deploy-sandbox-screenshot-queue",
]}]
[tasks.deploy-sandbox-screenshot-save]
script_runner = "@shell"
script = ["gcloud functions deploy saveScreenshotSandbox --trigger-http --project=ji-cloud-developer-sandbox --region=europe-west1 --source backend/screenshot --allow-unauthenticated --memory=1024MB --runtime=nodejs10 --timeout=540s"]
[tasks.deploy-sandbox-screenshot-show]
script_runner = "@shell"
script = ["gcloud functions deploy showScreenshotSandbox --trigger-http --project=ji-cloud-developer-sandbox --region=europe-west1 --source backend/screenshot --allow-unauthenticated --memory=1024MB --runtime=nodejs10 --timeout=540s"]
[tasks.deploy-sandbox-screenshot-queue]
script_runner = "@shell"
script = ["gcloud functions deploy queueScreenshotSandbox --trigger-http --project=ji-cloud-developer-sandbox --region=europe-west1 --source backend/screenshot --allow-unauthenticated --runtime=nodejs10"]