@catladder/pipeline 3.25.0 → 3.27.0
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.
- package/dist/build/custom/testJob.js +1 -2
- package/dist/build/node/testJob.js +1 -2
- package/dist/build/node/yarn.js +3 -2
- package/dist/build/rails/test.js +1 -2
- package/dist/constants.js +1 -1
- package/dist/deploy/types/googleCloudRun.d.ts +1 -1
- package/dist/pipeline/agent/createAgentReviewJob.js +1 -0
- package/dist/pipeline/agent/shared.d.ts +1 -1
- package/dist/pipeline/agent/shared.js +0 -1
- package/dist/pipeline/createMainPipeline.js +1 -0
- package/dist/pipeline/gitlab/cache.d.ts +9 -0
- package/dist/pipeline/gitlab/cache.js +47 -0
- package/dist/pipeline/gitlab/createGitlabJobs.js +7 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/jobs.d.ts +2 -3
- package/examples/__snapshots__/automatic-releases.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-health-check-defaults.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-health-check-only-startup.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-health-check.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-http2.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-memory-limit.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-meteor-with-worker.test.ts.snap +133 -27
- package/examples/__snapshots__/cloud-run-nextjs.test.ts.snap +144 -32
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-non-public.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-service-custom-vpc-connector.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-service-custom-vpc.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-service-gen2.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-service-increase-timout.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-storybook.test.ts.snap +21 -11
- package/examples/__snapshots__/cloud-run-with-agents.test.ts.snap +144 -32
- package/examples/__snapshots__/cloud-run-with-gpu.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-with-ngnix.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-with-sql-legacy-jobs.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-with-sql-multiple-dbs.test.ts.snap +423 -93
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +282 -62
- package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +141 -31
- package/examples/__snapshots__/cloud-run-with-worker.test.ts.snap +141 -31
- package/examples/__snapshots__/custom-build-job-with-tests.test.ts.snap +93 -22
- package/examples/__snapshots__/custom-deploy.test.ts.snap +141 -31
- package/examples/__snapshots__/custom-envs.test.ts.snap +328 -40
- package/examples/__snapshots__/custom-verify-job.test.ts.snap +144 -32
- package/examples/__snapshots__/git-submodule.test.ts.snap +141 -31
- package/examples/__snapshots__/kubernetes-application-customization.test.ts.snap +141 -31
- package/examples/__snapshots__/kubernetes-with-cloud-sql.test.ts.snap +141 -31
- package/examples/__snapshots__/kubernetes-with-jobs.test.ts.snap +282 -62
- package/examples/__snapshots__/kubernetes-with-mongodb.test.ts.snap +141 -31
- package/examples/__snapshots__/local-dot-env.test.ts.snap +141 -31
- package/examples/__snapshots__/meteor-kubernetes.test.ts.snap +133 -27
- package/examples/__snapshots__/modify-generated-files.test.ts.snap +124 -20
- package/examples/__snapshots__/modify-generated-yaml.test.ts.snap +124 -20
- package/examples/__snapshots__/multiline-var.test.ts.snap +423 -93
- package/examples/__snapshots__/native-app.test.ts.snap +277 -57
- package/examples/__snapshots__/node-build-with-custom-image.test.ts.snap +141 -31
- package/examples/__snapshots__/node-build-with-docker-additions.test.ts.snap +141 -31
- package/examples/__snapshots__/override-secrets.test.ts.snap +141 -31
- package/examples/__snapshots__/rails-k8s-with-worker-dockerfile.test.ts.snap +84 -22
- package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +84 -22
- package/examples/__snapshots__/referencing-other-vars.test.ts.snap +423 -93
- package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +260 -52
- package/examples/__snapshots__/workspace-api-www-turbo-cache.test.ts.snap +161 -43
- package/examples/__snapshots__/workspace-api-www.test.ts.snap +161 -43
- package/package.json +1 -1
- package/src/build/custom/testJob.ts +0 -1
- package/src/build/node/testJob.ts +0 -1
- package/src/build/node/yarn.ts +3 -2
- package/src/build/rails/test.ts +0 -1
- package/src/deploy/types/googleCloudRun.ts +1 -1
- package/src/pipeline/agent/createAgentReviewJob.ts +1 -0
- package/src/pipeline/agent/shared.ts +2 -2
- package/src/pipeline/createMainPipeline.ts +1 -0
- package/src/pipeline/gitlab/cache.ts +49 -0
- package/src/pipeline/gitlab/createGitlabJobs.ts +7 -9
- package/src/types/jobs.ts +2 -3
|
@@ -103,7 +103,7 @@ before_script:
|
|
|
103
103
|
local section_title="\${1}"
|
|
104
104
|
echo -e "section_end:\`date +%s\`:\${section_title}\\r\\e[0K"
|
|
105
105
|
}
|
|
106
|
-
🔸 myWorkspace 🛡 audit:
|
|
106
|
+
'🔸 myWorkspace 🛡 audit | dev ':
|
|
107
107
|
stage: test
|
|
108
108
|
image: path/to/docker/jobs-default:the-version
|
|
109
109
|
variables:
|
|
@@ -120,9 +120,6 @@ before_script:
|
|
|
120
120
|
- when: never
|
|
121
121
|
if: $CI_PIPELINE_SOURCE == "trigger"
|
|
122
122
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
|
|
123
|
-
- when: never
|
|
124
|
-
if: $CI_PIPELINE_SOURCE == "trigger"
|
|
125
|
-
- if: $CI_MERGE_REQUEST_ID
|
|
126
123
|
needs: []
|
|
127
124
|
retry: &a1
|
|
128
125
|
max: 2
|
|
@@ -131,7 +128,7 @@ before_script:
|
|
|
131
128
|
- stuck_or_timeout_failure
|
|
132
129
|
interruptible: true
|
|
133
130
|
allow_failure: true
|
|
134
|
-
🔸 myWorkspace 👮 lint:
|
|
131
|
+
'🔸 myWorkspace 👮 lint | dev ':
|
|
135
132
|
stage: test
|
|
136
133
|
image: path/to/docker/jobs-default:the-version
|
|
137
134
|
variables:
|
|
@@ -152,7 +149,7 @@ before_script:
|
|
|
152
149
|
- if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
|
|
153
150
|
- collapseable_section_end "nodeinstall"
|
|
154
151
|
- collapseable_section_start "yarninstall" "Yarn install"
|
|
155
|
-
- yarn install --immutable
|
|
152
|
+
- yarn install --immutable --inline-builds
|
|
156
153
|
- collapseable_section_end "yarninstall"
|
|
157
154
|
- yarn lint
|
|
158
155
|
cache:
|
|
@@ -168,13 +165,10 @@ before_script:
|
|
|
168
165
|
- when: never
|
|
169
166
|
if: $CI_PIPELINE_SOURCE == "trigger"
|
|
170
167
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
|
|
171
|
-
- when: never
|
|
172
|
-
if: $CI_PIPELINE_SOURCE == "trigger"
|
|
173
|
-
- if: $CI_MERGE_REQUEST_ID
|
|
174
168
|
needs: []
|
|
175
169
|
retry: *a1
|
|
176
170
|
interruptible: true
|
|
177
|
-
🔸 myWorkspace 🧪 test:
|
|
171
|
+
'🔸 myWorkspace 🧪 test | dev ':
|
|
178
172
|
stage: test
|
|
179
173
|
image: path/to/docker/jobs-testing-chrome:the-version
|
|
180
174
|
variables:
|
|
@@ -195,7 +189,7 @@ before_script:
|
|
|
195
189
|
- if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
|
|
196
190
|
- collapseable_section_end "nodeinstall"
|
|
197
191
|
- collapseable_section_start "yarninstall" "Yarn install"
|
|
198
|
-
- yarn install --immutable
|
|
192
|
+
- yarn install --immutable --inline-builds
|
|
199
193
|
- collapseable_section_end "yarninstall"
|
|
200
194
|
- yarn test
|
|
201
195
|
cache:
|
|
@@ -211,9 +205,6 @@ before_script:
|
|
|
211
205
|
- when: never
|
|
212
206
|
if: $CI_PIPELINE_SOURCE == "trigger"
|
|
213
207
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
|
|
214
|
-
- when: never
|
|
215
|
-
if: $CI_PIPELINE_SOURCE == "trigger"
|
|
216
|
-
- if: $CI_MERGE_REQUEST_ID
|
|
217
208
|
needs: []
|
|
218
209
|
retry: *a1
|
|
219
210
|
interruptible: true
|
|
@@ -272,7 +263,7 @@ before_script:
|
|
|
272
263
|
- if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
|
|
273
264
|
- collapseable_section_end "nodeinstall"
|
|
274
265
|
- collapseable_section_start "yarninstall" "Yarn install"
|
|
275
|
-
- yarn install --immutable
|
|
266
|
+
- yarn install --immutable --inline-builds
|
|
276
267
|
- collapseable_section_end "yarninstall"
|
|
277
268
|
- yarn build
|
|
278
269
|
cache:
|
|
@@ -309,6 +300,115 @@ before_script:
|
|
|
309
300
|
needs: []
|
|
310
301
|
retry: *a1
|
|
311
302
|
interruptible: true
|
|
303
|
+
'🔸 myWorkspace 🛡 audit | review ':
|
|
304
|
+
stage: test
|
|
305
|
+
image: path/to/docker/jobs-default:the-version
|
|
306
|
+
variables:
|
|
307
|
+
KUBERNETES_CPU_REQUEST: '0.45'
|
|
308
|
+
KUBERNETES_MEMORY_REQUEST: 1Gi
|
|
309
|
+
KUBERNETES_MEMORY_LIMIT: 4Gi
|
|
310
|
+
script:
|
|
311
|
+
- collapseable_section_start "injectvars" "Injecting variables"
|
|
312
|
+
- export APP_PATH="."
|
|
313
|
+
- collapseable_section_end "injectvars"
|
|
314
|
+
- cd .
|
|
315
|
+
- yarn npm audit --environment production
|
|
316
|
+
rules:
|
|
317
|
+
- when: never
|
|
318
|
+
if: $CI_PIPELINE_SOURCE == "trigger"
|
|
319
|
+
- if: $CI_MERGE_REQUEST_ID
|
|
320
|
+
needs: []
|
|
321
|
+
retry: *a1
|
|
322
|
+
interruptible: true
|
|
323
|
+
allow_failure: true
|
|
324
|
+
'🔸 myWorkspace 👮 lint | review ':
|
|
325
|
+
stage: test
|
|
326
|
+
image: path/to/docker/jobs-default:the-version
|
|
327
|
+
variables:
|
|
328
|
+
KUBERNETES_CPU_REQUEST: '0.45'
|
|
329
|
+
KUBERNETES_MEMORY_REQUEST: 1Gi
|
|
330
|
+
KUBERNETES_MEMORY_LIMIT: 4Gi
|
|
331
|
+
script:
|
|
332
|
+
- collapseable_section_start "injectvars" "Injecting variables"
|
|
333
|
+
- export APP_PATH="."
|
|
334
|
+
- collapseable_section_end "injectvars"
|
|
335
|
+
- collapseable_section_start "nodeinstall" "Ensure node version"
|
|
336
|
+
- if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
|
|
337
|
+
- if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
|
|
338
|
+
- collapseable_section_end "nodeinstall"
|
|
339
|
+
- cd .
|
|
340
|
+
- collapseable_section_start "nodeinstall" "Ensure node version"
|
|
341
|
+
- if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
|
|
342
|
+
- if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
|
|
343
|
+
- collapseable_section_end "nodeinstall"
|
|
344
|
+
- collapseable_section_start "yarninstall" "Yarn install"
|
|
345
|
+
- yarn install --immutable --inline-builds
|
|
346
|
+
- collapseable_section_end "yarninstall"
|
|
347
|
+
- yarn lint
|
|
348
|
+
cache:
|
|
349
|
+
- key: .-yarn-mr$CI_MERGE_REQUEST_IID
|
|
350
|
+
policy: pull-push
|
|
351
|
+
paths:
|
|
352
|
+
- .yarn
|
|
353
|
+
fallback_keys:
|
|
354
|
+
- .-yarn
|
|
355
|
+
- key: .-node-modules-mr$CI_MERGE_REQUEST_IID
|
|
356
|
+
policy: pull-push
|
|
357
|
+
paths:
|
|
358
|
+
- node_modules
|
|
359
|
+
fallback_keys:
|
|
360
|
+
- .-node-modules
|
|
361
|
+
rules:
|
|
362
|
+
- when: never
|
|
363
|
+
if: $CI_PIPELINE_SOURCE == "trigger"
|
|
364
|
+
- if: $CI_MERGE_REQUEST_ID
|
|
365
|
+
needs: []
|
|
366
|
+
retry: *a1
|
|
367
|
+
interruptible: true
|
|
368
|
+
'🔸 myWorkspace 🧪 test | review ':
|
|
369
|
+
stage: test
|
|
370
|
+
image: path/to/docker/jobs-testing-chrome:the-version
|
|
371
|
+
variables:
|
|
372
|
+
KUBERNETES_CPU_REQUEST: '0.45'
|
|
373
|
+
KUBERNETES_MEMORY_REQUEST: 1Gi
|
|
374
|
+
KUBERNETES_MEMORY_LIMIT: 4Gi
|
|
375
|
+
script:
|
|
376
|
+
- collapseable_section_start "injectvars" "Injecting variables"
|
|
377
|
+
- export APP_PATH="."
|
|
378
|
+
- collapseable_section_end "injectvars"
|
|
379
|
+
- collapseable_section_start "nodeinstall" "Ensure node version"
|
|
380
|
+
- if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
|
|
381
|
+
- if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
|
|
382
|
+
- collapseable_section_end "nodeinstall"
|
|
383
|
+
- cd .
|
|
384
|
+
- collapseable_section_start "nodeinstall" "Ensure node version"
|
|
385
|
+
- if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
|
|
386
|
+
- if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
|
|
387
|
+
- collapseable_section_end "nodeinstall"
|
|
388
|
+
- collapseable_section_start "yarninstall" "Yarn install"
|
|
389
|
+
- yarn install --immutable --inline-builds
|
|
390
|
+
- collapseable_section_end "yarninstall"
|
|
391
|
+
- yarn test
|
|
392
|
+
cache:
|
|
393
|
+
- key: .-yarn-mr$CI_MERGE_REQUEST_IID
|
|
394
|
+
policy: pull-push
|
|
395
|
+
paths:
|
|
396
|
+
- .yarn
|
|
397
|
+
fallback_keys:
|
|
398
|
+
- .-yarn
|
|
399
|
+
- key: .-node-modules-mr$CI_MERGE_REQUEST_IID
|
|
400
|
+
policy: pull-push
|
|
401
|
+
paths:
|
|
402
|
+
- node_modules
|
|
403
|
+
fallback_keys:
|
|
404
|
+
- .-node-modules
|
|
405
|
+
rules:
|
|
406
|
+
- when: never
|
|
407
|
+
if: $CI_PIPELINE_SOURCE == "trigger"
|
|
408
|
+
- if: $CI_MERGE_REQUEST_ID
|
|
409
|
+
needs: []
|
|
410
|
+
retry: *a1
|
|
411
|
+
interruptible: true
|
|
312
412
|
'🔸 myWorkspace 🔨 app | review ':
|
|
313
413
|
stage: build
|
|
314
414
|
image: path/to/docker/jobs-default:the-version
|
|
@@ -364,22 +464,28 @@ before_script:
|
|
|
364
464
|
- if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
|
|
365
465
|
- collapseable_section_end "nodeinstall"
|
|
366
466
|
- collapseable_section_start "yarninstall" "Yarn install"
|
|
367
|
-
- yarn install --immutable
|
|
467
|
+
- yarn install --immutable --inline-builds
|
|
368
468
|
- collapseable_section_end "yarninstall"
|
|
369
469
|
- yarn build
|
|
370
470
|
cache:
|
|
371
|
-
- key: .-yarn
|
|
471
|
+
- key: .-yarn-mr$CI_MERGE_REQUEST_IID
|
|
372
472
|
policy: pull-push
|
|
373
473
|
paths:
|
|
374
474
|
- .yarn
|
|
375
|
-
|
|
475
|
+
fallback_keys:
|
|
476
|
+
- .-yarn
|
|
477
|
+
- key: .-node-modules-mr$CI_MERGE_REQUEST_IID
|
|
376
478
|
policy: pull-push
|
|
377
479
|
paths:
|
|
378
480
|
- node_modules
|
|
379
|
-
|
|
481
|
+
fallback_keys:
|
|
482
|
+
- .-node-modules
|
|
483
|
+
- key: myWorkspace-default-mr$CI_MERGE_REQUEST_IID
|
|
380
484
|
policy: pull-push
|
|
381
485
|
paths:
|
|
382
486
|
- www/.next/cache
|
|
487
|
+
fallback_keys:
|
|
488
|
+
- myWorkspace-default
|
|
383
489
|
artifacts:
|
|
384
490
|
paths:
|
|
385
491
|
- api/.next
|
|
@@ -456,7 +562,7 @@ before_script:
|
|
|
456
562
|
- if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
|
|
457
563
|
- collapseable_section_end "nodeinstall"
|
|
458
564
|
- collapseable_section_start "yarninstall" "Yarn install"
|
|
459
|
-
- yarn install --immutable
|
|
565
|
+
- yarn install --immutable --inline-builds
|
|
460
566
|
- collapseable_section_end "yarninstall"
|
|
461
567
|
- yarn build
|
|
462
568
|
cache:
|
|
@@ -548,7 +654,7 @@ before_script:
|
|
|
548
654
|
- if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
|
|
549
655
|
- collapseable_section_end "nodeinstall"
|
|
550
656
|
- collapseable_section_start "yarninstall" "Yarn install"
|
|
551
|
-
- yarn install --immutable
|
|
657
|
+
- yarn install --immutable --inline-builds
|
|
552
658
|
- collapseable_section_end "yarninstall"
|
|
553
659
|
- yarn build
|
|
554
660
|
cache:
|
|
@@ -610,7 +716,8 @@ before_script:
|
|
|
610
716
|
- export DOCKER_CACHE_IMAGE="europe-west6-docker.pkg.dev/google-project-id/catladder-deploy/pan-test-app/caches/api"
|
|
611
717
|
- export DOCKER_IMAGE_TAG="$CI_COMMIT_SHA"
|
|
612
718
|
- |-
|
|
613
|
-
export DOCKER_COPY_AND_INSTALL_APP="
|
|
719
|
+
export DOCKER_COPY_AND_INSTALL_APP="ENV YARN_ENABLE_INLINE_BUILDS=1
|
|
720
|
+
COPY --chown=node:node $APP_DIR .
|
|
614
721
|
RUN yarn plugin import workspace-tools
|
|
615
722
|
RUN yarn workspaces focus --production && yarn rebuild"
|
|
616
723
|
- |-
|
|
@@ -764,11 +871,11 @@ before_script:
|
|
|
764
871
|
- when: on_success
|
|
765
872
|
if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
|
|
766
873
|
needs:
|
|
767
|
-
- job: 🔸 myWorkspace 👮 lint
|
|
874
|
+
- job: '🔸 myWorkspace 👮 lint | dev '
|
|
768
875
|
artifacts: false
|
|
769
|
-
- job: 🔸 myWorkspace 🧪 test
|
|
876
|
+
- job: '🔸 myWorkspace 🧪 test | dev '
|
|
770
877
|
artifacts: false
|
|
771
|
-
- job: 🔸 myWorkspace 🛡 audit
|
|
878
|
+
- job: '🔸 myWorkspace 🛡 audit | dev '
|
|
772
879
|
artifacts: false
|
|
773
880
|
- job: '🔹 api 🔨 docker | dev '
|
|
774
881
|
artifacts: false
|
|
@@ -836,7 +943,8 @@ before_script:
|
|
|
836
943
|
- export DOCKER_CACHE_IMAGE="europe-west6-docker.pkg.dev/google-project-id/catladder-deploy/pan-test-app/caches/api"
|
|
837
944
|
- export DOCKER_IMAGE_TAG="$CI_COMMIT_SHA"
|
|
838
945
|
- |-
|
|
839
|
-
export DOCKER_COPY_AND_INSTALL_APP="
|
|
946
|
+
export DOCKER_COPY_AND_INSTALL_APP="ENV YARN_ENABLE_INLINE_BUILDS=1
|
|
947
|
+
COPY --chown=node:node $APP_DIR .
|
|
840
948
|
RUN yarn plugin import workspace-tools
|
|
841
949
|
RUN yarn workspaces focus --production && yarn rebuild"
|
|
842
950
|
- |-
|
|
@@ -859,10 +967,12 @@ before_script:
|
|
|
859
967
|
- docker push $DOCKER_CACHE_IMAGE
|
|
860
968
|
- collapseable_section_end "docker-push"
|
|
861
969
|
cache:
|
|
862
|
-
- key: api-yarn
|
|
970
|
+
- key: api-yarn-mr$CI_MERGE_REQUEST_IID
|
|
863
971
|
policy: pull
|
|
864
972
|
paths:
|
|
865
973
|
- api/.yarn
|
|
974
|
+
fallback_keys:
|
|
975
|
+
- api-yarn
|
|
866
976
|
rules:
|
|
867
977
|
- when: never
|
|
868
978
|
if: $CI_PIPELINE_SOURCE == "trigger"
|
|
@@ -993,11 +1103,11 @@ before_script:
|
|
|
993
1103
|
- when: on_success
|
|
994
1104
|
if: $CI_MERGE_REQUEST_ID
|
|
995
1105
|
needs:
|
|
996
|
-
- job: 🔸 myWorkspace 👮 lint
|
|
1106
|
+
- job: '🔸 myWorkspace 👮 lint | review '
|
|
997
1107
|
artifacts: false
|
|
998
|
-
- job: 🔸 myWorkspace 🧪 test
|
|
1108
|
+
- job: '🔸 myWorkspace 🧪 test | review '
|
|
999
1109
|
artifacts: false
|
|
1000
|
-
- job: 🔸 myWorkspace 🛡 audit
|
|
1110
|
+
- job: '🔸 myWorkspace 🛡 audit | review '
|
|
1001
1111
|
artifacts: false
|
|
1002
1112
|
- job: '🔹 api 🔨 docker | review '
|
|
1003
1113
|
artifacts: false
|
|
@@ -1068,7 +1178,8 @@ before_script:
|
|
|
1068
1178
|
- export DOCKER_CACHE_IMAGE="europe-west6-docker.pkg.dev/google-project-id/catladder-deploy/pan-test-app/caches/api"
|
|
1069
1179
|
- export DOCKER_IMAGE_TAG="$CI_COMMIT_SHA"
|
|
1070
1180
|
- |-
|
|
1071
|
-
export DOCKER_COPY_AND_INSTALL_APP="
|
|
1181
|
+
export DOCKER_COPY_AND_INSTALL_APP="ENV YARN_ENABLE_INLINE_BUILDS=1
|
|
1182
|
+
COPY --chown=node:node $APP_DIR .
|
|
1072
1183
|
RUN yarn plugin import workspace-tools
|
|
1073
1184
|
RUN yarn workspaces focus --production && yarn rebuild"
|
|
1074
1185
|
- |-
|
|
@@ -1287,7 +1398,8 @@ before_script:
|
|
|
1287
1398
|
- export DOCKER_CACHE_IMAGE="europe-west6-docker.pkg.dev/google-project-id/catladder-deploy/pan-test-app/caches/api"
|
|
1288
1399
|
- export DOCKER_IMAGE_TAG="$CI_COMMIT_SHA"
|
|
1289
1400
|
- |-
|
|
1290
|
-
export DOCKER_COPY_AND_INSTALL_APP="
|
|
1401
|
+
export DOCKER_COPY_AND_INSTALL_APP="ENV YARN_ENABLE_INLINE_BUILDS=1
|
|
1402
|
+
COPY --chown=node:node $APP_DIR .
|
|
1291
1403
|
RUN yarn plugin import workspace-tools
|
|
1292
1404
|
RUN yarn workspaces focus --production && yarn rebuild"
|
|
1293
1405
|
- |-
|
|
@@ -1506,7 +1618,8 @@ before_script:
|
|
|
1506
1618
|
- export DOCKER_CACHE_IMAGE="europe-west6-docker.pkg.dev/google-project-id/catladder-deploy/pan-test-app/caches/www"
|
|
1507
1619
|
- export DOCKER_IMAGE_TAG="$CI_COMMIT_SHA"
|
|
1508
1620
|
- |-
|
|
1509
|
-
export DOCKER_COPY_AND_INSTALL_APP="
|
|
1621
|
+
export DOCKER_COPY_AND_INSTALL_APP="ENV YARN_ENABLE_INLINE_BUILDS=1
|
|
1622
|
+
COPY --chown=node:node $APP_DIR .
|
|
1510
1623
|
RUN yarn plugin import workspace-tools
|
|
1511
1624
|
RUN yarn workspaces focus --production && yarn rebuild"
|
|
1512
1625
|
- |-
|
|
@@ -1663,11 +1776,11 @@ before_script:
|
|
|
1663
1776
|
- when: on_success
|
|
1664
1777
|
if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
|
|
1665
1778
|
needs:
|
|
1666
|
-
- job: 🔸 myWorkspace 👮 lint
|
|
1779
|
+
- job: '🔸 myWorkspace 👮 lint | dev '
|
|
1667
1780
|
artifacts: false
|
|
1668
|
-
- job: 🔸 myWorkspace 🧪 test
|
|
1781
|
+
- job: '🔸 myWorkspace 🧪 test | dev '
|
|
1669
1782
|
artifacts: false
|
|
1670
|
-
- job: 🔸 myWorkspace 🛡 audit
|
|
1783
|
+
- job: '🔸 myWorkspace 🛡 audit | dev '
|
|
1671
1784
|
artifacts: false
|
|
1672
1785
|
- job: '🔹 www 🔨 docker | dev '
|
|
1673
1786
|
artifacts: false
|
|
@@ -1735,7 +1848,8 @@ before_script:
|
|
|
1735
1848
|
- export DOCKER_CACHE_IMAGE="europe-west6-docker.pkg.dev/google-project-id/catladder-deploy/pan-test-app/caches/www"
|
|
1736
1849
|
- export DOCKER_IMAGE_TAG="$CI_COMMIT_SHA"
|
|
1737
1850
|
- |-
|
|
1738
|
-
export DOCKER_COPY_AND_INSTALL_APP="
|
|
1851
|
+
export DOCKER_COPY_AND_INSTALL_APP="ENV YARN_ENABLE_INLINE_BUILDS=1
|
|
1852
|
+
COPY --chown=node:node $APP_DIR .
|
|
1739
1853
|
RUN yarn plugin import workspace-tools
|
|
1740
1854
|
RUN yarn workspaces focus --production && yarn rebuild"
|
|
1741
1855
|
- |-
|
|
@@ -1758,10 +1872,12 @@ before_script:
|
|
|
1758
1872
|
- docker push $DOCKER_CACHE_IMAGE
|
|
1759
1873
|
- collapseable_section_end "docker-push"
|
|
1760
1874
|
cache:
|
|
1761
|
-
- key: www-yarn
|
|
1875
|
+
- key: www-yarn-mr$CI_MERGE_REQUEST_IID
|
|
1762
1876
|
policy: pull
|
|
1763
1877
|
paths:
|
|
1764
1878
|
- www/.yarn
|
|
1879
|
+
fallback_keys:
|
|
1880
|
+
- www-yarn
|
|
1765
1881
|
rules:
|
|
1766
1882
|
- when: never
|
|
1767
1883
|
if: $CI_PIPELINE_SOURCE == "trigger"
|
|
@@ -1895,11 +2011,11 @@ before_script:
|
|
|
1895
2011
|
- when: on_success
|
|
1896
2012
|
if: $CI_MERGE_REQUEST_ID
|
|
1897
2013
|
needs:
|
|
1898
|
-
- job: 🔸 myWorkspace 👮 lint
|
|
2014
|
+
- job: '🔸 myWorkspace 👮 lint | review '
|
|
1899
2015
|
artifacts: false
|
|
1900
|
-
- job: 🔸 myWorkspace 🧪 test
|
|
2016
|
+
- job: '🔸 myWorkspace 🧪 test | review '
|
|
1901
2017
|
artifacts: false
|
|
1902
|
-
- job: 🔸 myWorkspace 🛡 audit
|
|
2018
|
+
- job: '🔸 myWorkspace 🛡 audit | review '
|
|
1903
2019
|
artifacts: false
|
|
1904
2020
|
- job: '🔹 www 🔨 docker | review '
|
|
1905
2021
|
artifacts: false
|
|
@@ -1970,7 +2086,8 @@ before_script:
|
|
|
1970
2086
|
- export DOCKER_CACHE_IMAGE="europe-west6-docker.pkg.dev/google-project-id/catladder-deploy/pan-test-app/caches/www"
|
|
1971
2087
|
- export DOCKER_IMAGE_TAG="$CI_COMMIT_SHA"
|
|
1972
2088
|
- |-
|
|
1973
|
-
export DOCKER_COPY_AND_INSTALL_APP="
|
|
2089
|
+
export DOCKER_COPY_AND_INSTALL_APP="ENV YARN_ENABLE_INLINE_BUILDS=1
|
|
2090
|
+
COPY --chown=node:node $APP_DIR .
|
|
1974
2091
|
RUN yarn plugin import workspace-tools
|
|
1975
2092
|
RUN yarn workspaces focus --production && yarn rebuild"
|
|
1976
2093
|
- |-
|
|
@@ -2192,7 +2309,8 @@ before_script:
|
|
|
2192
2309
|
- export DOCKER_CACHE_IMAGE="europe-west6-docker.pkg.dev/google-project-id/catladder-deploy/pan-test-app/caches/www"
|
|
2193
2310
|
- export DOCKER_IMAGE_TAG="$CI_COMMIT_SHA"
|
|
2194
2311
|
- |-
|
|
2195
|
-
export DOCKER_COPY_AND_INSTALL_APP="
|
|
2312
|
+
export DOCKER_COPY_AND_INSTALL_APP="ENV YARN_ENABLE_INLINE_BUILDS=1
|
|
2313
|
+
COPY --chown=node:node $APP_DIR .
|
|
2196
2314
|
RUN yarn plugin import workspace-tools
|
|
2197
2315
|
RUN yarn workspaces focus --production && yarn rebuild"
|
|
2198
2316
|
- |-
|
package/package.json
CHANGED
package/src/build/node/yarn.ts
CHANGED
|
@@ -12,8 +12,8 @@ const getYarnInstallCommand = (context: Context) => {
|
|
|
12
12
|
if (context.packageManagerInfo.isClassic) {
|
|
13
13
|
return YARN_INSTALL_CLASSIC;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
return `yarn install --immutable`;
|
|
15
|
+
// inline builds make debugging easier as it prints it out in the logs, instead of writing it in temp files
|
|
16
|
+
return `yarn install --immutable --inline-builds`;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export const ensureNodeVersion = (context: Context) =>
|
|
@@ -78,6 +78,7 @@ RUN ${YARN_INSTALL_CLASSIC} --production
|
|
|
78
78
|
// rebuild first does not work as it will run postinstall and that might require files in the app
|
|
79
79
|
return new BashExpression(
|
|
80
80
|
`
|
|
81
|
+
ENV YARN_ENABLE_INLINE_BUILDS=1
|
|
81
82
|
${DOCKER_COPY_FILES}
|
|
82
83
|
${maybeAddWorkspaceToolsCommand}
|
|
83
84
|
RUN ${YARN_BERRY_PROD_REBUILD}
|
package/src/build/rails/test.ts
CHANGED
|
@@ -559,7 +559,7 @@ export type DeployConfigCloudRunExecuteHttp = {
|
|
|
559
559
|
/**
|
|
560
560
|
* the http-method to use. Defaults to "POST" (as specified by google cloud scheduler)
|
|
561
561
|
*/
|
|
562
|
-
method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
562
|
+
method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "PURGE";
|
|
563
563
|
|
|
564
564
|
/**
|
|
565
565
|
* the body to send
|
|
@@ -8,9 +8,9 @@ import type { AgentContext, CatladderJob } from "../../types";
|
|
|
8
8
|
|
|
9
9
|
export const createBaseAgentJob = (
|
|
10
10
|
context: AgentContext,
|
|
11
|
-
): Omit<CatladderJob, "name" | "rules" | "script"> => ({
|
|
11
|
+
): Omit<CatladderJob, "name" | "rules" | "script" | "envMode"> => ({
|
|
12
12
|
stage: "agents",
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
// image: "node:24-alpine3.21",
|
|
15
15
|
image: getRunnerImage("agent-claude"),
|
|
16
16
|
variables: {
|
|
@@ -80,6 +80,7 @@ export const createMainPipeline = async <T extends PipelineType>(
|
|
|
80
80
|
(acc, { gitlabJob, name, context }) => {
|
|
81
81
|
// merge jobs, if a job is already there, merge the rules
|
|
82
82
|
// this is currently needed because of envMode: "none", which creates the same job for all triggers, so it can appear multiple times
|
|
83
|
+
// NOTICE: envNode none has been removed and this may no longer be needed
|
|
83
84
|
if (acc[name]) {
|
|
84
85
|
acc[name].gitlabJob.rules = [
|
|
85
86
|
...(acc[name].gitlabJob.rules ?? []),
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AgentContext,
|
|
3
|
+
CatladderJobCache,
|
|
4
|
+
Context,
|
|
5
|
+
GitlabJobCache,
|
|
6
|
+
} from "../../types";
|
|
7
|
+
|
|
8
|
+
export const getCacheKeyWithFallbackForMR = (
|
|
9
|
+
baseKey: string,
|
|
10
|
+
context: Context,
|
|
11
|
+
) => {
|
|
12
|
+
// if its a branch, create a key with the branch name with fallback to the base key
|
|
13
|
+
if (context.trigger === "mr") {
|
|
14
|
+
return {
|
|
15
|
+
key: baseKey + "-mr$CI_MERGE_REQUEST_IID",
|
|
16
|
+
fallback_keys: [baseKey],
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
key: baseKey,
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const addCacheFallback = (
|
|
26
|
+
cache: GitlabJobCache | GitlabJobCache[],
|
|
27
|
+
context: Context | AgentContext,
|
|
28
|
+
) => {
|
|
29
|
+
if (context.type !== "agent" && context.trigger === "mr") {
|
|
30
|
+
if (Array.isArray(cache)) {
|
|
31
|
+
return cache.map((c) => addCacheFallbackToSingleCacheForMR(c, context));
|
|
32
|
+
}
|
|
33
|
+
return addCacheFallbackToSingleCacheForMR(cache, context);
|
|
34
|
+
}
|
|
35
|
+
return cache;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const addCacheFallbackToSingleCacheForMR = (
|
|
39
|
+
cache: CatladderJobCache,
|
|
40
|
+
context: Context,
|
|
41
|
+
) => {
|
|
42
|
+
if (typeof cache.key === "string") {
|
|
43
|
+
return {
|
|
44
|
+
...cache,
|
|
45
|
+
...getCacheKeyWithFallbackForMR(cache.key, context),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return cache; // as is
|
|
49
|
+
};
|
|
@@ -15,6 +15,7 @@ import { collapseableSection } from "../../utils/gitlab";
|
|
|
15
15
|
import { removeUndefined } from "../../utils/removeUndefined";
|
|
16
16
|
import type { AllCatladderJobs } from "../createAllJobs";
|
|
17
17
|
import { getBashVariable } from "../../bash/BashExpression";
|
|
18
|
+
import { addCacheFallback } from "./cache";
|
|
18
19
|
|
|
19
20
|
export type GitlabJobWithContext = {
|
|
20
21
|
gitlabJob: GitlabJobDef;
|
|
@@ -60,12 +61,12 @@ const getFullReferencedJobNameFromComponent = (
|
|
|
60
61
|
`unknown job referenced: '${referencedJobName}' from '${env}:${componentName}'`,
|
|
61
62
|
);
|
|
62
63
|
}
|
|
63
|
-
|
|
64
|
+
|
|
64
65
|
return getFullJobName({
|
|
65
66
|
type: "component",
|
|
66
67
|
name: referencedJobName,
|
|
67
68
|
baseName: componentName,
|
|
68
|
-
env
|
|
69
|
+
env,
|
|
69
70
|
allJobs,
|
|
70
71
|
});
|
|
71
72
|
};
|
|
@@ -84,13 +85,12 @@ const getFullReferencedJobNameFromWorkspace = (
|
|
|
84
85
|
`unknown job referenced: '${referencedJobName}' from workspace ${env}:${workspaceName}'`,
|
|
85
86
|
);
|
|
86
87
|
}
|
|
87
|
-
const envToSet = referencedJob.envMode !== "none" ? env : null;
|
|
88
88
|
|
|
89
89
|
return getFullJobName({
|
|
90
90
|
type: "workspace",
|
|
91
91
|
name: referencedJobName,
|
|
92
92
|
baseName: workspaceName,
|
|
93
|
-
env
|
|
93
|
+
env,
|
|
94
94
|
allJobs,
|
|
95
95
|
});
|
|
96
96
|
};
|
|
@@ -116,6 +116,7 @@ export const makeGitlabJob = (
|
|
|
116
116
|
variables,
|
|
117
117
|
runnerVariables,
|
|
118
118
|
when,
|
|
119
|
+
cache,
|
|
119
120
|
...rest
|
|
120
121
|
} = job;
|
|
121
122
|
const stage =
|
|
@@ -133,8 +134,7 @@ export const makeGitlabJob = (
|
|
|
133
134
|
type: context.type,
|
|
134
135
|
name,
|
|
135
136
|
baseName: context.name,
|
|
136
|
-
env:
|
|
137
|
-
envMode !== "none" && context.type !== "agent" ? context.env : undefined,
|
|
137
|
+
env: context.type !== "agent" ? context.env : undefined,
|
|
138
138
|
allJobs,
|
|
139
139
|
});
|
|
140
140
|
|
|
@@ -186,11 +186,11 @@ export const makeGitlabJob = (
|
|
|
186
186
|
? [{ when }]
|
|
187
187
|
: []),
|
|
188
188
|
];
|
|
189
|
-
|
|
190
189
|
const gitlabJob: GitlabJobDef = {
|
|
191
190
|
retry: BASE_RETRY,
|
|
192
191
|
interruptible: true,
|
|
193
192
|
...rest,
|
|
193
|
+
cache: cache ? addCacheFallback(cache, context) : undefined,
|
|
194
194
|
rules: rules.length > 0 ? rules : undefined,
|
|
195
195
|
variables: {
|
|
196
196
|
...legacyRunnerVariables,
|
|
@@ -283,8 +283,6 @@ export const createGitlabJobs = async (
|
|
|
283
283
|
allJobs: AllCatladderJobs,
|
|
284
284
|
baseRules?: GitlabRule[],
|
|
285
285
|
): Promise<AllGitlabJobs> => {
|
|
286
|
-
// TODO: add workspace jobs
|
|
287
|
-
|
|
288
286
|
return [
|
|
289
287
|
...allJobs.workspaces,
|
|
290
288
|
...allJobs.components,
|
package/src/types/jobs.ts
CHANGED
|
@@ -38,11 +38,10 @@ export type CatladderJob<S = BaseStage> = {
|
|
|
38
38
|
name: string;
|
|
39
39
|
/**
|
|
40
40
|
* envMode sets the behavior of the job regarding multiple envs:
|
|
41
|
-
* -
|
|
42
|
-
* - jobPerEnv: the job runs once per env
|
|
41
|
+
* - jobPerEnv: the job runs once per env (default)
|
|
43
42
|
* - stagePerEnv: the job runs once per env and is organized in its own stage. This mproves usability in gitlab, but works the same as `jobPerEnv`
|
|
44
43
|
*/
|
|
45
|
-
envMode
|
|
44
|
+
envMode?: "jobPerEnv" | "stagePerEnv";
|
|
46
45
|
|
|
47
46
|
/**
|
|
48
47
|
* the stage of the job
|