@catladder/pipeline 1.162.0 โ†’ 1.163.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +15 -1
  2. package/dist/build/types.d.ts +6 -0
  3. package/dist/bundles/catladder-gitlab/index.js +2 -2
  4. package/dist/constants.js +1 -1
  5. package/dist/pipeline/generatePipelineFiles.d.ts +38 -0
  6. package/dist/pipeline/generatePipelineFiles.js +44 -23
  7. package/dist/tsconfig.tsbuildinfo +1 -1
  8. package/examples/__snapshots__/cloud-run-memory-limit.test.ts.snap +1341 -0
  9. package/examples/__snapshots__/cloud-run-meteor-with-worker.test.ts.snap +1325 -0
  10. package/examples/__snapshots__/cloud-run-no-cpu-throttling.test.ts.snap +1341 -0
  11. package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +1393 -0
  12. package/examples/__snapshots__/cloud-run-non-public.test.ts.snap +1341 -0
  13. package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +1352 -0
  14. package/examples/__snapshots__/cloud-run-service-gen2.test.ts.snap +1341 -0
  15. package/examples/__snapshots__/cloud-run-service-increase-timout.test.ts.snap +1341 -0
  16. package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +1385 -0
  17. package/examples/__snapshots__/cloud-run-storybook.test.ts.snap +1233 -4
  18. package/examples/__snapshots__/cloud-run-with-ngnix.test.ts.snap +1349 -4
  19. package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +2825 -0
  20. package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +2572 -0
  21. package/examples/__snapshots__/cloud-run-with-worker.test.ts.snap +1349 -0
  22. package/examples/__snapshots__/custom-build-job-with-tests.test.ts.snap +1196 -0
  23. package/examples/__snapshots__/custom-build-job.test.ts.snap +1085 -0
  24. package/examples/__snapshots__/custom-deploy.test.ts.snap +1103 -0
  25. package/examples/__snapshots__/custom-envs.test.ts.snap +709 -0
  26. package/examples/__snapshots__/custom-sbom-java.test.ts.snap +1093 -0
  27. package/examples/__snapshots__/git-submodule.test.ts.snap +1342 -0
  28. package/examples/__snapshots__/kubernetes-application-customization.test.ts.snap +1778 -0
  29. package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.test.ts.snap +1790 -0
  30. package/examples/__snapshots__/kubernetes-with-cloud-sql.test.ts.snap +1798 -0
  31. package/examples/__snapshots__/kubernetes-with-jobs.test.ts.snap +3352 -0
  32. package/examples/__snapshots__/kubernetes-with-mongodb.test.ts.snap +1902 -0
  33. package/examples/__snapshots__/local-dot-env.test.ts.snap +1341 -0
  34. package/examples/__snapshots__/meteor-kubernetes.test.ts.snap +1839 -0
  35. package/examples/__snapshots__/multiline-var.test.ts.snap +3376 -0
  36. package/examples/__snapshots__/native-app.test.ts.snap +2149 -0
  37. package/examples/__snapshots__/node-build-with-custom-image.test.ts.snap +1341 -0
  38. package/examples/__snapshots__/node-build-with-docker-additions.test.ts.snap +1349 -0
  39. package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +1470 -0
  40. package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +1275 -0
  41. package/examples/__utils__/helpers.ts +14 -1
  42. package/examples/cloud-run-memory-limit.test.ts +9 -1
  43. package/examples/cloud-run-meteor-with-worker.test.ts +9 -1
  44. package/examples/cloud-run-no-cpu-throttling.test.ts +9 -1
  45. package/examples/cloud-run-no-service.test.ts +9 -1
  46. package/examples/cloud-run-non-public.test.ts +9 -1
  47. package/examples/cloud-run-post-stop-job.test.ts +9 -1
  48. package/examples/cloud-run-service-gen2.test.ts +9 -1
  49. package/examples/cloud-run-service-increase-timout.test.ts +9 -1
  50. package/examples/cloud-run-service-with-volumes.test.ts +9 -1
  51. package/examples/cloud-run-storybook.test.ts +9 -1
  52. package/examples/cloud-run-storybook.ts +9 -1
  53. package/examples/cloud-run-with-ngnix.test.ts +9 -1
  54. package/examples/cloud-run-with-ngnix.ts +5 -1
  55. package/examples/cloud-run-with-sql-reuse-db.test.ts +9 -1
  56. package/examples/cloud-run-with-sql.test.ts +9 -1
  57. package/examples/cloud-run-with-worker.test.ts +9 -1
  58. package/examples/custom-build-job-with-tests.test.ts +9 -1
  59. package/examples/custom-build-job.test.ts +9 -1
  60. package/examples/custom-deploy.test.ts +9 -1
  61. package/examples/custom-envs.test.ts +9 -1
  62. package/examples/custom-sbom-java.test.ts +9 -1
  63. package/examples/git-submodule.test.ts +9 -1
  64. package/examples/kubernetes-application-customization.test.ts +9 -1
  65. package/examples/kubernetes-with-cloud-sql-legacy.test.ts +9 -1
  66. package/examples/kubernetes-with-cloud-sql.test.ts +9 -1
  67. package/examples/kubernetes-with-jobs.test.ts +9 -1
  68. package/examples/kubernetes-with-mongodb.test.ts +9 -1
  69. package/examples/local-dot-env.test.ts +9 -1
  70. package/examples/meteor-kubernetes.test.ts +9 -1
  71. package/examples/multiline-var.test.ts +9 -1
  72. package/examples/native-app.test.ts +9 -1
  73. package/examples/node-build-with-custom-image.test.ts +9 -1
  74. package/examples/node-build-with-docker-additions.test.ts +9 -1
  75. package/examples/rails-k8s-with-worker.test.ts +9 -1
  76. package/examples/wait-for-other-deploy.test.ts +9 -1
  77. package/package.json +4 -3
  78. package/scripts/generate-examples-test.ts +7 -5
  79. package/src/build/types.ts +6 -0
  80. package/src/pipeline/generatePipelineFiles.ts +61 -36
@@ -1,5 +1,714 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`matches snapshot for cloud-run-memory-limit local pipeline YAML 1`] = `
4
+ "image: path/to/docker/jobs-default:the-version
5
+ stages:
6
+ - setup
7
+ - setup dev
8
+ - setup review
9
+ - setup stage
10
+ - setup prod
11
+ - setup asdf
12
+ - setup bla
13
+ - test
14
+ - test dev
15
+ - test review
16
+ - test stage
17
+ - test prod
18
+ - test asdf
19
+ - test bla
20
+ - build
21
+ - build dev
22
+ - build review
23
+ - build stage
24
+ - build prod
25
+ - build asdf
26
+ - build bla
27
+ - deploy
28
+ - deploy dev
29
+ - deploy review
30
+ - deploy stage
31
+ - deploy prod
32
+ - deploy asdf
33
+ - deploy bla
34
+ - verify
35
+ - verify dev
36
+ - verify review
37
+ - verify stage
38
+ - verify prod
39
+ - verify asdf
40
+ - verify bla
41
+ - rollback
42
+ - rollback dev
43
+ - rollback review
44
+ - rollback stage
45
+ - rollback prod
46
+ - rollback asdf
47
+ - rollback bla
48
+ - stop
49
+ - stop dev
50
+ - stop review
51
+ - stop stage
52
+ - stop prod
53
+ - stop asdf
54
+ - stop bla
55
+ - release
56
+ variables:
57
+ FF_USE_FASTZIP: 'true'
58
+ ARTIFACT_COMPRESSION_LEVEL: fast
59
+ CACHE_COMPRESSION_LEVEL: fast
60
+ TRANSFER_METER_FREQUENCY: 5s
61
+ GIT_DEPTH: '1'
62
+ api ๐Ÿ›ก audit:
63
+ stage: test
64
+ image: path/to/docker/jobs-default:the-version
65
+ variables:
66
+ KUBERNETES_CPU_REQUEST: '0.45'
67
+ KUBERNETES_MEMORY_REQUEST: 1Gi
68
+ KUBERNETES_MEMORY_LIMIT: 4Gi
69
+ script:
70
+ - echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"
71
+ - export APP_PATH="api"
72
+ - echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"
73
+ - cd api
74
+ - yarn npm audit --environment production
75
+ rules:
76
+ - when: never
77
+ if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
78
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
79
+ - when: never
80
+ if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
81
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
82
+ - when: never
83
+ if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
84
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
85
+ - if: $CI_MERGE_REQUEST_ID
86
+ needs: []
87
+ retry: &a1
88
+ max: 2
89
+ when:
90
+ - runner_system_failure
91
+ - stuck_or_timeout_failure
92
+ interruptible: true
93
+ allow_failure: true
94
+ api ๐Ÿ‘ฎ lint:
95
+ stage: test
96
+ image: path/to/docker/jobs-default:the-version
97
+ variables:
98
+ KUBERNETES_CPU_REQUEST: '0.45'
99
+ KUBERNETES_MEMORY_REQUEST: 1Gi
100
+ KUBERNETES_MEMORY_LIMIT: 4Gi
101
+ script:
102
+ - echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"
103
+ - export APP_PATH="api"
104
+ - echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"
105
+ - echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"
106
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
107
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
108
+ - echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"
109
+ - cd api
110
+ - echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"
111
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
112
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
113
+ - echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"
114
+ - echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"
115
+ - yarn install --immutable
116
+ - echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"
117
+ - yarn lint
118
+ cache:
119
+ - key: api-yarn
120
+ policy: pull-push
121
+ paths:
122
+ - api/.yarn
123
+ - key: api-node-modules
124
+ policy: pull-push
125
+ paths:
126
+ - api/node_modules
127
+ rules:
128
+ - when: never
129
+ if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
130
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
131
+ - when: never
132
+ if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
133
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
134
+ - when: never
135
+ if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
136
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
137
+ - if: $CI_MERGE_REQUEST_ID
138
+ needs: []
139
+ retry: *a1
140
+ interruptible: true
141
+ api ๐Ÿงช test:
142
+ stage: test
143
+ image: path/to/docker/jobs-testing-chrome:the-version
144
+ variables:
145
+ KUBERNETES_CPU_REQUEST: '0.45'
146
+ KUBERNETES_MEMORY_REQUEST: 1Gi
147
+ KUBERNETES_MEMORY_LIMIT: 4Gi
148
+ script:
149
+ - echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"
150
+ - export APP_PATH="api"
151
+ - echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"
152
+ - echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"
153
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
154
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
155
+ - echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"
156
+ - cd api
157
+ - echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"
158
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
159
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
160
+ - echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"
161
+ - echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"
162
+ - yarn install --immutable
163
+ - echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"
164
+ - yarn test
165
+ cache:
166
+ - key: api-yarn
167
+ policy: pull-push
168
+ paths:
169
+ - api/.yarn
170
+ - key: api-node-modules
171
+ policy: pull-push
172
+ paths:
173
+ - api/node_modules
174
+ rules:
175
+ - when: never
176
+ if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
177
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
178
+ - when: never
179
+ if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
180
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
181
+ - when: never
182
+ if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
183
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
184
+ - if: $CI_MERGE_REQUEST_ID
185
+ needs: []
186
+ retry: *a1
187
+ interruptible: true
188
+ 'api ๐Ÿ”จ app | dev ':
189
+ stage: build
190
+ image: path/to/docker/jobs-default:the-version
191
+ variables:
192
+ KUBERNETES_CPU_REQUEST: '0.45'
193
+ KUBERNETES_MEMORY_REQUEST: 1Gi
194
+ KUBERNETES_MEMORY_LIMIT: 4Gi
195
+ script:
196
+ - echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"
197
+ - export ENV_SHORT="dev"
198
+ - export APP_DIR="api"
199
+ - export ENV_TYPE="dev"
200
+ - export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"
201
+ - export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"
202
+ - export BUILD_INFO_CURRENT_VERSION="$(tag=$(git ls-remote origin "refs/tags/v*[0-9]" 2>/dev/null | cut -f 2- | sort -V | tail -1 | sed 's/refs\\/tags\\/v//'); [ -z "$tag" ] && echo "0.0.0" || echo "$tag")"
203
+ - export HOST="unknown-host.example.com"
204
+ - export ROOT_URL="https://unknown-host.example.com"
205
+ - export HOST_INTERNAL="unknown-host.example.com"
206
+ - export HOST_CANONICAL="unknown-host.example.com"
207
+ - export ROOT_URL_INTERNAL="https://unknown-host.example.com"
208
+ - export _ALL_ENV_VAR_KEYS="[\\"ENV_SHORT\\",\\"APP_DIR\\",\\"ENV_TYPE\\",\\"BUILD_INFO_BUILD_ID\\",\\"BUILD_INFO_BUILD_TIME\\",\\"BUILD_INFO_CURRENT_VERSION\\",\\"HOST\\",\\"ROOT_URL\\",\\"HOST_INTERNAL\\",\\"HOST_CANONICAL\\",\\"ROOT_URL_INTERNAL\\"]"
209
+ - echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"
210
+ - echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > api/__build_info.json
211
+ - echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"
212
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
213
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
214
+ - echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"
215
+ - cd api
216
+ - echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"
217
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
218
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
219
+ - echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"
220
+ - echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"
221
+ - yarn install --immutable
222
+ - echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"
223
+ - yarn build
224
+ cache:
225
+ - key: api-yarn
226
+ policy: pull-push
227
+ paths:
228
+ - api/.yarn
229
+ - key: api-node-modules
230
+ policy: pull-push
231
+ paths:
232
+ - api/node_modules
233
+ - key: api-next-cache
234
+ policy: pull-push
235
+ paths:
236
+ - api/.next/cache
237
+ artifacts:
238
+ paths:
239
+ - api/__build_info.json
240
+ - api/.next
241
+ - api/dist
242
+ expire_in: 1 day
243
+ when: always
244
+ reports: {}
245
+ rules:
246
+ - when: never
247
+ if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
248
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
249
+ needs: []
250
+ retry: *a1
251
+ interruptible: true
252
+ 'api ๐Ÿงพ sbom | dev ':
253
+ stage: build
254
+ image: aquasec/trivy:0.38.3
255
+ variables: {}
256
+ script:
257
+ - echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"
258
+ - echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"
259
+ - trivy fs --quiet --format cyclonedx --output "__sbom.json" api
260
+ artifacts:
261
+ paths:
262
+ - __sbom.json
263
+ rules:
264
+ - when: never
265
+ if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
266
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
267
+ needs: []
268
+ retry: *a1
269
+ interruptible: true
270
+ allow_failure: true
271
+ 'api ๐Ÿ”จ app | asdf ':
272
+ stage: build
273
+ image: path/to/docker/jobs-default:the-version
274
+ variables:
275
+ KUBERNETES_CPU_REQUEST: '0.45'
276
+ KUBERNETES_MEMORY_REQUEST: 1Gi
277
+ KUBERNETES_MEMORY_LIMIT: 4Gi
278
+ script:
279
+ - echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"
280
+ - export ENV_SHORT="asdf"
281
+ - export APP_DIR="api"
282
+ - export ENV_TYPE="dev"
283
+ - export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"
284
+ - export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"
285
+ - export BUILD_INFO_CURRENT_VERSION="$(tag=$(git ls-remote origin "refs/tags/v*[0-9]" 2>/dev/null | cut -f 2- | sort -V | tail -1 | sed 's/refs\\/tags\\/v//'); [ -z "$tag" ] && echo "0.0.0" || echo "$tag")"
286
+ - export HOST="unknown-host.example.com"
287
+ - export ROOT_URL="https://unknown-host.example.com"
288
+ - export HOST_INTERNAL="unknown-host.example.com"
289
+ - export HOST_CANONICAL="unknown-host.example.com"
290
+ - export ROOT_URL_INTERNAL="https://unknown-host.example.com"
291
+ - export _ALL_ENV_VAR_KEYS="[\\"ENV_SHORT\\",\\"APP_DIR\\",\\"ENV_TYPE\\",\\"BUILD_INFO_BUILD_ID\\",\\"BUILD_INFO_BUILD_TIME\\",\\"BUILD_INFO_CURRENT_VERSION\\",\\"HOST\\",\\"ROOT_URL\\",\\"HOST_INTERNAL\\",\\"HOST_CANONICAL\\",\\"ROOT_URL_INTERNAL\\"]"
292
+ - echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"
293
+ - echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > api/__build_info.json
294
+ - echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"
295
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
296
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
297
+ - echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"
298
+ - cd api
299
+ - echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"
300
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
301
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
302
+ - echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"
303
+ - echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"
304
+ - yarn install --immutable
305
+ - echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"
306
+ - yarn build
307
+ cache:
308
+ - key: api-yarn
309
+ policy: pull-push
310
+ paths:
311
+ - api/.yarn
312
+ - key: api-node-modules
313
+ policy: pull-push
314
+ paths:
315
+ - api/node_modules
316
+ - key: api-next-cache
317
+ policy: pull-push
318
+ paths:
319
+ - api/.next/cache
320
+ artifacts:
321
+ paths:
322
+ - api/__build_info.json
323
+ - api/.next
324
+ - api/dist
325
+ expire_in: 1 day
326
+ when: always
327
+ reports: {}
328
+ rules:
329
+ - when: never
330
+ if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
331
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
332
+ needs: []
333
+ retry: *a1
334
+ interruptible: true
335
+ 'api ๐Ÿงพ sbom | asdf ':
336
+ stage: build
337
+ image: aquasec/trivy:0.38.3
338
+ variables: {}
339
+ script:
340
+ - echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"
341
+ - echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"
342
+ - trivy fs --quiet --format cyclonedx --output "__sbom.json" api
343
+ artifacts:
344
+ paths:
345
+ - __sbom.json
346
+ rules:
347
+ - when: never
348
+ if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
349
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
350
+ needs: []
351
+ retry: *a1
352
+ interruptible: true
353
+ allow_failure: true
354
+ 'api ๐Ÿ”จ app | bla ':
355
+ stage: build
356
+ image: path/to/docker/jobs-default:the-version
357
+ variables:
358
+ KUBERNETES_CPU_REQUEST: '0.45'
359
+ KUBERNETES_MEMORY_REQUEST: 1Gi
360
+ KUBERNETES_MEMORY_LIMIT: 4Gi
361
+ script:
362
+ - echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"
363
+ - export ENV_SHORT="bla"
364
+ - export APP_DIR="api"
365
+ - export ENV_TYPE="dev"
366
+ - export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"
367
+ - export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"
368
+ - export BUILD_INFO_CURRENT_VERSION="$(tag=$(git ls-remote origin "refs/tags/v*[0-9]" 2>/dev/null | cut -f 2- | sort -V | tail -1 | sed 's/refs\\/tags\\/v//'); [ -z "$tag" ] && echo "0.0.0" || echo "$tag")"
369
+ - export HOST="unknown-host.example.com"
370
+ - export ROOT_URL="https://unknown-host.example.com"
371
+ - export HOST_INTERNAL="unknown-host.example.com"
372
+ - export HOST_CANONICAL="unknown-host.example.com"
373
+ - export ROOT_URL_INTERNAL="https://unknown-host.example.com"
374
+ - export _ALL_ENV_VAR_KEYS="[\\"ENV_SHORT\\",\\"APP_DIR\\",\\"ENV_TYPE\\",\\"BUILD_INFO_BUILD_ID\\",\\"BUILD_INFO_BUILD_TIME\\",\\"BUILD_INFO_CURRENT_VERSION\\",\\"HOST\\",\\"ROOT_URL\\",\\"HOST_INTERNAL\\",\\"HOST_CANONICAL\\",\\"ROOT_URL_INTERNAL\\"]"
375
+ - echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"
376
+ - echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > api/__build_info.json
377
+ - echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"
378
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
379
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
380
+ - echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"
381
+ - cd api
382
+ - echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"
383
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
384
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
385
+ - echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"
386
+ - echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"
387
+ - yarn install --immutable
388
+ - echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"
389
+ - yarn build
390
+ cache:
391
+ - key: api-yarn
392
+ policy: pull-push
393
+ paths:
394
+ - api/.yarn
395
+ - key: api-node-modules
396
+ policy: pull-push
397
+ paths:
398
+ - api/node_modules
399
+ - key: api-next-cache
400
+ policy: pull-push
401
+ paths:
402
+ - api/.next/cache
403
+ artifacts:
404
+ paths:
405
+ - api/__build_info.json
406
+ - api/.next
407
+ - api/dist
408
+ expire_in: 1 day
409
+ when: always
410
+ reports: {}
411
+ rules:
412
+ - when: never
413
+ if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
414
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
415
+ needs: []
416
+ retry: *a1
417
+ interruptible: true
418
+ 'api ๐Ÿงพ sbom | bla ':
419
+ stage: build
420
+ image: aquasec/trivy:0.38.3
421
+ variables: {}
422
+ script:
423
+ - echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"
424
+ - echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"
425
+ - trivy fs --quiet --format cyclonedx --output "__sbom.json" api
426
+ artifacts:
427
+ paths:
428
+ - __sbom.json
429
+ rules:
430
+ - when: never
431
+ if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
432
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
433
+ needs: []
434
+ retry: *a1
435
+ interruptible: true
436
+ allow_failure: true
437
+ 'api ๐Ÿ”จ app | review ':
438
+ stage: build
439
+ image: path/to/docker/jobs-default:the-version
440
+ variables:
441
+ KUBERNETES_CPU_REQUEST: '0.45'
442
+ KUBERNETES_MEMORY_REQUEST: 1Gi
443
+ KUBERNETES_MEMORY_LIMIT: 4Gi
444
+ script:
445
+ - echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"
446
+ - export ENV_SHORT="review"
447
+ - export APP_DIR="api"
448
+ - export ENV_TYPE="review"
449
+ - export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"
450
+ - export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"
451
+ - export BUILD_INFO_CURRENT_VERSION="$(tag=$(git ls-remote origin "refs/tags/v*[0-9]" 2>/dev/null | cut -f 2- | sort -V | tail -1 | sed 's/refs\\/tags\\/v//'); [ -z "$tag" ] && echo "0.0.0" || echo "$tag")"
452
+ - export HOST="unknown-host.example.com"
453
+ - export ROOT_URL="https://unknown-host.example.com"
454
+ - export HOST_INTERNAL="unknown-host.example.com"
455
+ - export HOST_CANONICAL="unknown-host.example.com"
456
+ - export ROOT_URL_INTERNAL="https://unknown-host.example.com"
457
+ - export _ALL_ENV_VAR_KEYS="[\\"ENV_SHORT\\",\\"APP_DIR\\",\\"ENV_TYPE\\",\\"BUILD_INFO_BUILD_ID\\",\\"BUILD_INFO_BUILD_TIME\\",\\"BUILD_INFO_CURRENT_VERSION\\",\\"HOST\\",\\"ROOT_URL\\",\\"HOST_INTERNAL\\",\\"HOST_CANONICAL\\",\\"ROOT_URL_INTERNAL\\"]"
458
+ - echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"
459
+ - echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > api/__build_info.json
460
+ - echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"
461
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
462
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
463
+ - echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"
464
+ - cd api
465
+ - echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"
466
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
467
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
468
+ - echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"
469
+ - echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"
470
+ - yarn install --immutable
471
+ - echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"
472
+ - yarn build
473
+ cache:
474
+ - key: api-yarn
475
+ policy: pull-push
476
+ paths:
477
+ - api/.yarn
478
+ - key: api-node-modules
479
+ policy: pull-push
480
+ paths:
481
+ - api/node_modules
482
+ - key: api-next-cache
483
+ policy: pull-push
484
+ paths:
485
+ - api/.next/cache
486
+ artifacts:
487
+ paths:
488
+ - api/__build_info.json
489
+ - api/.next
490
+ - api/dist
491
+ expire_in: 1 day
492
+ when: always
493
+ reports: {}
494
+ rules:
495
+ - if: $CI_MERGE_REQUEST_ID
496
+ needs: []
497
+ retry: *a1
498
+ interruptible: true
499
+ 'api ๐Ÿงพ sbom | review ':
500
+ stage: build
501
+ image: aquasec/trivy:0.38.3
502
+ variables: {}
503
+ script:
504
+ - echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"
505
+ - echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"
506
+ - trivy fs --quiet --format cyclonedx --output "__sbom.json" api
507
+ artifacts:
508
+ paths:
509
+ - __sbom.json
510
+ rules:
511
+ - if: $CI_MERGE_REQUEST_ID
512
+ needs: []
513
+ retry: *a1
514
+ interruptible: true
515
+ allow_failure: true
516
+ 'api ๐Ÿ”จ app | stage ':
517
+ stage: build
518
+ image: path/to/docker/jobs-default:the-version
519
+ variables:
520
+ KUBERNETES_CPU_REQUEST: '0.45'
521
+ KUBERNETES_MEMORY_REQUEST: 1Gi
522
+ KUBERNETES_MEMORY_LIMIT: 4Gi
523
+ script:
524
+ - echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"
525
+ - export ENV_SHORT="stage"
526
+ - export APP_DIR="api"
527
+ - export ENV_TYPE="stage"
528
+ - export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"
529
+ - export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"
530
+ - export BUILD_INFO_CURRENT_VERSION="$(tag=$(git ls-remote origin "refs/tags/v*[0-9]" 2>/dev/null | cut -f 2- | sort -V | tail -1 | sed 's/refs\\/tags\\/v//'); [ -z "$tag" ] && echo "0.0.0" || echo "$tag")"
531
+ - export HOST="unknown-host.example.com"
532
+ - export ROOT_URL="https://unknown-host.example.com"
533
+ - export HOST_INTERNAL="unknown-host.example.com"
534
+ - export HOST_CANONICAL="unknown-host.example.com"
535
+ - export ROOT_URL_INTERNAL="https://unknown-host.example.com"
536
+ - export _ALL_ENV_VAR_KEYS="[\\"ENV_SHORT\\",\\"APP_DIR\\",\\"ENV_TYPE\\",\\"BUILD_INFO_BUILD_ID\\",\\"BUILD_INFO_BUILD_TIME\\",\\"BUILD_INFO_CURRENT_VERSION\\",\\"HOST\\",\\"ROOT_URL\\",\\"HOST_INTERNAL\\",\\"HOST_CANONICAL\\",\\"ROOT_URL_INTERNAL\\"]"
537
+ - echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"
538
+ - echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > api/__build_info.json
539
+ - echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"
540
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
541
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
542
+ - echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"
543
+ - cd api
544
+ - echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"
545
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
546
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
547
+ - echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"
548
+ - echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"
549
+ - yarn install --immutable
550
+ - echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"
551
+ - yarn build
552
+ cache:
553
+ - key: api-yarn
554
+ policy: pull-push
555
+ paths:
556
+ - api/.yarn
557
+ - key: api-node-modules
558
+ policy: pull-push
559
+ paths:
560
+ - api/node_modules
561
+ - key: api-next-cache
562
+ policy: pull-push
563
+ paths:
564
+ - api/.next/cache
565
+ artifacts:
566
+ paths:
567
+ - api/__build_info.json
568
+ - api/.next
569
+ - api/dist
570
+ expire_in: 1 day
571
+ when: always
572
+ reports: {}
573
+ rules:
574
+ - if: $CI_COMMIT_TAG
575
+ needs: []
576
+ retry: *a1
577
+ interruptible: true
578
+ 'api ๐Ÿงพ sbom | stage ':
579
+ stage: build
580
+ image: aquasec/trivy:0.38.3
581
+ variables: {}
582
+ script:
583
+ - echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"
584
+ - echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"
585
+ - trivy fs --quiet --format cyclonedx --output "__sbom.json" api
586
+ artifacts:
587
+ paths:
588
+ - __sbom.json
589
+ rules:
590
+ - if: $CI_COMMIT_TAG
591
+ needs: []
592
+ retry: *a1
593
+ interruptible: true
594
+ allow_failure: true
595
+ 'api ๐Ÿ”จ app | prod ':
596
+ stage: build
597
+ image: path/to/docker/jobs-default:the-version
598
+ variables:
599
+ KUBERNETES_CPU_REQUEST: '0.45'
600
+ KUBERNETES_MEMORY_REQUEST: 1Gi
601
+ KUBERNETES_MEMORY_LIMIT: 4Gi
602
+ script:
603
+ - echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"
604
+ - export ENV_SHORT="prod"
605
+ - export APP_DIR="api"
606
+ - export ENV_TYPE="prod"
607
+ - export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"
608
+ - export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"
609
+ - export BUILD_INFO_CURRENT_VERSION="$(tag=$(git ls-remote origin "refs/tags/v*[0-9]" 2>/dev/null | cut -f 2- | sort -V | tail -1 | sed 's/refs\\/tags\\/v//'); [ -z "$tag" ] && echo "0.0.0" || echo "$tag")"
610
+ - export HOST="unknown-host.example.com"
611
+ - export ROOT_URL="https://unknown-host.example.com"
612
+ - export HOST_INTERNAL="unknown-host.example.com"
613
+ - export HOST_CANONICAL="unknown-host.example.com"
614
+ - export ROOT_URL_INTERNAL="https://unknown-host.example.com"
615
+ - export _ALL_ENV_VAR_KEYS="[\\"ENV_SHORT\\",\\"APP_DIR\\",\\"ENV_TYPE\\",\\"BUILD_INFO_BUILD_ID\\",\\"BUILD_INFO_BUILD_TIME\\",\\"BUILD_INFO_CURRENT_VERSION\\",\\"HOST\\",\\"ROOT_URL\\",\\"HOST_INTERNAL\\",\\"HOST_CANONICAL\\",\\"ROOT_URL_INTERNAL\\"]"
616
+ - echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"
617
+ - echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > api/__build_info.json
618
+ - echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"
619
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
620
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
621
+ - echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"
622
+ - cd api
623
+ - echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"
624
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
625
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
626
+ - echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"
627
+ - echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"
628
+ - yarn install --immutable
629
+ - echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"
630
+ - yarn build
631
+ cache:
632
+ - key: api-yarn
633
+ policy: pull-push
634
+ paths:
635
+ - api/.yarn
636
+ - key: api-node-modules
637
+ policy: pull-push
638
+ paths:
639
+ - api/node_modules
640
+ - key: api-next-cache
641
+ policy: pull-push
642
+ paths:
643
+ - api/.next/cache
644
+ artifacts:
645
+ paths:
646
+ - api/__build_info.json
647
+ - api/.next
648
+ - api/dist
649
+ expire_in: 1 day
650
+ when: always
651
+ reports: {}
652
+ rules:
653
+ - if: $CI_COMMIT_TAG
654
+ needs: []
655
+ retry: *a1
656
+ interruptible: true
657
+ 'api ๐Ÿงพ sbom | prod ':
658
+ stage: build
659
+ image: aquasec/trivy:0.38.3
660
+ variables: {}
661
+ script:
662
+ - echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"
663
+ - echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"
664
+ - trivy fs --quiet --format cyclonedx --output "__sbom.json" api
665
+ artifacts:
666
+ paths:
667
+ - __sbom.json
668
+ rules:
669
+ - if: $CI_COMMIT_TAG
670
+ needs: []
671
+ retry: *a1
672
+ interruptible: true
673
+ allow_failure: true
674
+ create release:
675
+ stage: release
676
+ image: path/to/docker/semantic-release:the-version
677
+ script:
678
+ - semanticRelease
679
+ after_script:
680
+ - echo '๐Ÿ‘‰ The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
681
+ rules:
682
+ - &a2
683
+ if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
684
+ when: never
685
+ - &a3
686
+ if: $CI_PIPELINE_SOURCE == "schedule"
687
+ when: never
688
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $AUTO_RELEASE == "true"
689
+ when: on_success
690
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
691
+ when: manual
692
+ - if: $CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/
693
+ when: manual
694
+ โš ๏ธ force create release:
695
+ stage: release
696
+ image: path/to/docker/semantic-release:the-version
697
+ script:
698
+ - semanticRelease
699
+ after_script:
700
+ - echo '๐Ÿ‘‰ The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
701
+ rules:
702
+ - *a2
703
+ - *a3
704
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
705
+ when: manual
706
+ - if: $CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/
707
+ when: manual
708
+ needs: []
709
+ "
710
+ `;
711
+
3
712
  exports[`matches snapshot for custom-envs 1`] = `
4
713
  {
5
714
  "mainBranch": {