@catladder/pipeline 3.24.0 โ†’ 3.26.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.
Files changed (75) hide show
  1. package/dist/build/custom/testJob.js +1 -2
  2. package/dist/build/index.js +2 -1
  3. package/dist/build/node/testJob.js +1 -2
  4. package/dist/build/rails/test.js +1 -2
  5. package/dist/constants.js +1 -1
  6. package/dist/pipeline/agent/createAgentReviewJob.js +1 -0
  7. package/dist/pipeline/agent/shared.d.ts +1 -1
  8. package/dist/pipeline/agent/shared.js +0 -1
  9. package/dist/pipeline/createMainPipeline.js +1 -0
  10. package/dist/pipeline/gitlab/cache.d.ts +9 -0
  11. package/dist/pipeline/gitlab/cache.js +47 -0
  12. package/dist/pipeline/gitlab/createGitlabJobs.js +7 -7
  13. package/dist/tsconfig.tsbuildinfo +1 -1
  14. package/dist/types/jobs.d.ts +2 -3
  15. package/examples/__snapshots__/automatic-releases.test.ts.snap +131 -21
  16. package/examples/__snapshots__/cloud-run-health-check-defaults.test.ts.snap +131 -21
  17. package/examples/__snapshots__/cloud-run-health-check-only-startup.test.ts.snap +131 -21
  18. package/examples/__snapshots__/cloud-run-health-check.test.ts.snap +131 -21
  19. package/examples/__snapshots__/cloud-run-http2.test.ts.snap +131 -21
  20. package/examples/__snapshots__/cloud-run-memory-limit.test.ts.snap +131 -21
  21. package/examples/__snapshots__/cloud-run-meteor-with-worker.test.ts.snap +127 -21
  22. package/examples/__snapshots__/cloud-run-nextjs.test.ts.snap +134 -22
  23. package/examples/__snapshots__/cloud-run-no-cpu-throttling.test.ts.snap +131 -21
  24. package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +131 -21
  25. package/examples/__snapshots__/cloud-run-non-public.test.ts.snap +131 -21
  26. package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +131 -21
  27. package/examples/__snapshots__/cloud-run-service-custom-vpc-connector.test.ts.snap +131 -21
  28. package/examples/__snapshots__/cloud-run-service-custom-vpc.test.ts.snap +131 -21
  29. package/examples/__snapshots__/cloud-run-service-gen2.test.ts.snap +131 -21
  30. package/examples/__snapshots__/cloud-run-service-increase-timout.test.ts.snap +131 -21
  31. package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +131 -21
  32. package/examples/__snapshots__/cloud-run-storybook.test.ts.snap +13 -3
  33. package/examples/__snapshots__/cloud-run-with-agents.test.ts.snap +134 -22
  34. package/examples/__snapshots__/cloud-run-with-gpu.test.ts.snap +131 -21
  35. package/examples/__snapshots__/cloud-run-with-ngnix.test.ts.snap +131 -21
  36. package/examples/__snapshots__/cloud-run-with-sql-legacy-jobs.test.ts.snap +131 -21
  37. package/examples/__snapshots__/cloud-run-with-sql-multiple-dbs.test.ts.snap +393 -63
  38. package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +262 -42
  39. package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +131 -21
  40. package/examples/__snapshots__/cloud-run-with-worker.test.ts.snap +131 -21
  41. package/examples/__snapshots__/custom-build-job-with-tests.test.ts.snap +93 -22
  42. package/examples/__snapshots__/custom-deploy.test.ts.snap +131 -21
  43. package/examples/__snapshots__/custom-envs.test.ts.snap +326 -32
  44. package/examples/__snapshots__/custom-verify-job.test.ts.snap +134 -22
  45. package/examples/__snapshots__/git-submodule.test.ts.snap +131 -21
  46. package/examples/__snapshots__/kubernetes-application-customization.test.ts.snap +135 -21
  47. package/examples/__snapshots__/kubernetes-with-cloud-sql.test.ts.snap +135 -21
  48. package/examples/__snapshots__/kubernetes-with-jobs.test.ts.snap +266 -42
  49. package/examples/__snapshots__/kubernetes-with-mongodb.test.ts.snap +135 -21
  50. package/examples/__snapshots__/local-dot-env.test.ts.snap +135 -21
  51. package/examples/__snapshots__/meteor-kubernetes.test.ts.snap +127 -21
  52. package/examples/__snapshots__/modify-generated-files.test.ts.snap +122 -14
  53. package/examples/__snapshots__/modify-generated-yaml.test.ts.snap +122 -14
  54. package/examples/__snapshots__/multiline-var.test.ts.snap +393 -63
  55. package/examples/__snapshots__/native-app.test.ts.snap +265 -41
  56. package/examples/__snapshots__/node-build-with-custom-image.test.ts.snap +131 -21
  57. package/examples/__snapshots__/node-build-with-docker-additions.test.ts.snap +131 -21
  58. package/examples/__snapshots__/override-secrets.test.ts.snap +131 -21
  59. package/examples/__snapshots__/rails-k8s-with-worker-dockerfile.test.ts.snap +84 -22
  60. package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +84 -22
  61. package/examples/__snapshots__/referencing-other-vars.test.ts.snap +393 -63
  62. package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +256 -40
  63. package/examples/__snapshots__/workspace-api-www-turbo-cache.test.ts.snap +147 -29
  64. package/examples/__snapshots__/workspace-api-www.test.ts.snap +147 -29
  65. package/package.json +1 -1
  66. package/src/build/custom/testJob.ts +0 -1
  67. package/src/build/index.ts +1 -0
  68. package/src/build/node/testJob.ts +0 -1
  69. package/src/build/rails/test.ts +0 -1
  70. package/src/pipeline/agent/createAgentReviewJob.ts +1 -0
  71. package/src/pipeline/agent/shared.ts +2 -2
  72. package/src/pipeline/createMainPipeline.ts +1 -0
  73. package/src/pipeline/gitlab/cache.ts +49 -0
  74. package/src/pipeline/gitlab/createGitlabJobs.ts +7 -9
  75. 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
- app ๐Ÿ›ก audit:
106
+ 'app ๐Ÿ›ก audit | dev ':
107
107
  stage: test
108
108
  image: path/to/docker/jobs-default:the-version
109
109
  variables:
@@ -122,9 +122,6 @@ app ๐Ÿ›ก audit:
122
122
  - when: never
123
123
  if: $CI_PIPELINE_SOURCE == "trigger"
124
124
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
125
- - when: never
126
- if: $CI_PIPELINE_SOURCE == "trigger"
127
- - if: $CI_MERGE_REQUEST_ID
128
125
  needs: []
129
126
  retry: &a1
130
127
  max: 2
@@ -133,7 +130,7 @@ app ๐Ÿ›ก audit:
133
130
  - stuck_or_timeout_failure
134
131
  interruptible: true
135
132
  allow_failure: true
136
- app ๐Ÿ‘ฎ lint:
133
+ 'app ๐Ÿ‘ฎ lint | dev ':
137
134
  stage: test
138
135
  image: path/to/docker/jobs-default:the-version
139
136
  variables:
@@ -172,13 +169,10 @@ app ๐Ÿ‘ฎ lint:
172
169
  - when: never
173
170
  if: $CI_PIPELINE_SOURCE == "trigger"
174
171
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
175
- - when: never
176
- if: $CI_PIPELINE_SOURCE == "trigger"
177
- - if: $CI_MERGE_REQUEST_ID
178
172
  needs: []
179
173
  retry: *a1
180
174
  interruptible: true
181
- app ๐Ÿงช test:
175
+ 'app ๐Ÿงช test | dev ':
182
176
  stage: test
183
177
  image: path/to/docker/jobs-testing-chrome:the-version
184
178
  variables:
@@ -217,9 +211,6 @@ app ๐Ÿงช test:
217
211
  - when: never
218
212
  if: $CI_PIPELINE_SOURCE == "trigger"
219
213
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
220
- - when: never
221
- if: $CI_PIPELINE_SOURCE == "trigger"
222
- - if: $CI_MERGE_REQUEST_ID
223
214
  needs: []
224
215
  retry: *a1
225
216
  interruptible: true
@@ -309,6 +300,7 @@ app ๐Ÿงช test:
309
300
  - app/dist
310
301
  exclude:
311
302
  - app/.env
303
+ - app/.next/cache/**/*
312
304
  expire_in: 1 day
313
305
  when: always
314
306
  reports: {}
@@ -397,19 +389,134 @@ app ๐Ÿงช test:
397
389
  - when: on_success
398
390
  if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
399
391
  needs:
400
- - job: app ๐Ÿ‘ฎ lint
392
+ - job: 'app ๐Ÿ‘ฎ lint | dev '
401
393
  artifacts: false
402
394
  - job: 'app ๐Ÿ”จ app | dev '
403
395
  artifacts: true
404
- - job: app ๐Ÿงช test
396
+ - job: 'app ๐Ÿงช test | dev '
405
397
  artifacts: false
406
398
  - job: 'app ๐Ÿงพ sbom | dev '
407
399
  artifacts: true
408
- - job: app ๐Ÿ›ก audit
400
+ - job: 'app ๐Ÿ›ก audit | dev '
409
401
  artifacts: false
410
402
  retry: *a1
411
403
  interruptible: true
412
404
  allow_failure: false
405
+ 'app ๐Ÿ›ก audit | review ':
406
+ stage: test
407
+ image: path/to/docker/jobs-default:the-version
408
+ variables:
409
+ KUBERNETES_CPU_REQUEST: '0.45'
410
+ KUBERNETES_MEMORY_REQUEST: 1Gi
411
+ KUBERNETES_MEMORY_LIMIT: 4Gi
412
+ script:
413
+ - collapseable_section_start "injectvars" "Injecting variables"
414
+ - export APP_PATH="app"
415
+ - export LC_A="L=en_US.UTF-8"
416
+ - export LANG="en_US.UTF-8"
417
+ - collapseable_section_end "injectvars"
418
+ - cd app
419
+ - yarn npm audit --environment production
420
+ rules:
421
+ - when: never
422
+ if: $CI_PIPELINE_SOURCE == "trigger"
423
+ - if: $CI_MERGE_REQUEST_ID
424
+ needs: []
425
+ retry: *a1
426
+ interruptible: true
427
+ allow_failure: true
428
+ 'app ๐Ÿ‘ฎ lint | review ':
429
+ stage: test
430
+ image: path/to/docker/jobs-default:the-version
431
+ variables:
432
+ KUBERNETES_CPU_REQUEST: '0.45'
433
+ KUBERNETES_MEMORY_REQUEST: 1Gi
434
+ KUBERNETES_MEMORY_LIMIT: 4Gi
435
+ script:
436
+ - collapseable_section_start "injectvars" "Injecting variables"
437
+ - export APP_PATH="app"
438
+ - export LC_A="L=en_US.UTF-8"
439
+ - export LANG="en_US.UTF-8"
440
+ - collapseable_section_end "injectvars"
441
+ - collapseable_section_start "nodeinstall" "Ensure node version"
442
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
443
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
444
+ - collapseable_section_end "nodeinstall"
445
+ - cd app
446
+ - collapseable_section_start "nodeinstall" "Ensure node version"
447
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
448
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
449
+ - collapseable_section_end "nodeinstall"
450
+ - collapseable_section_start "yarninstall" "Yarn install"
451
+ - yarn install --immutable
452
+ - collapseable_section_end "yarninstall"
453
+ - yarn lint
454
+ cache:
455
+ - key: app-yarn-mr$CI_MERGE_REQUEST_IID
456
+ policy: pull-push
457
+ paths:
458
+ - app/.yarn
459
+ fallback_keys:
460
+ - app-yarn
461
+ - key: app-node-modules-mr$CI_MERGE_REQUEST_IID
462
+ policy: pull-push
463
+ paths:
464
+ - app/node_modules
465
+ fallback_keys:
466
+ - app-node-modules
467
+ rules:
468
+ - when: never
469
+ if: $CI_PIPELINE_SOURCE == "trigger"
470
+ - if: $CI_MERGE_REQUEST_ID
471
+ needs: []
472
+ retry: *a1
473
+ interruptible: true
474
+ 'app ๐Ÿงช test | review ':
475
+ stage: test
476
+ image: path/to/docker/jobs-testing-chrome:the-version
477
+ variables:
478
+ KUBERNETES_CPU_REQUEST: '0.45'
479
+ KUBERNETES_MEMORY_REQUEST: 1Gi
480
+ KUBERNETES_MEMORY_LIMIT: 4Gi
481
+ script:
482
+ - collapseable_section_start "injectvars" "Injecting variables"
483
+ - export APP_PATH="app"
484
+ - export LC_A="L=en_US.UTF-8"
485
+ - export LANG="en_US.UTF-8"
486
+ - collapseable_section_end "injectvars"
487
+ - collapseable_section_start "nodeinstall" "Ensure node version"
488
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
489
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
490
+ - collapseable_section_end "nodeinstall"
491
+ - cd app
492
+ - collapseable_section_start "nodeinstall" "Ensure node version"
493
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
494
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
495
+ - collapseable_section_end "nodeinstall"
496
+ - collapseable_section_start "yarninstall" "Yarn install"
497
+ - yarn install --immutable
498
+ - collapseable_section_end "yarninstall"
499
+ - yarn test
500
+ cache:
501
+ - key: app-yarn-mr$CI_MERGE_REQUEST_IID
502
+ policy: pull-push
503
+ paths:
504
+ - app/.yarn
505
+ fallback_keys:
506
+ - app-yarn
507
+ - key: app-node-modules-mr$CI_MERGE_REQUEST_IID
508
+ policy: pull-push
509
+ paths:
510
+ - app/node_modules
511
+ fallback_keys:
512
+ - app-node-modules
513
+ rules:
514
+ - when: never
515
+ if: $CI_PIPELINE_SOURCE == "trigger"
516
+ - if: $CI_MERGE_REQUEST_ID
517
+ needs: []
518
+ retry: *a1
519
+ interruptible: true
413
520
  'app ๐Ÿ”จ app | review ':
414
521
  stage: build
415
522
  tags:
@@ -475,14 +582,18 @@ app ๐Ÿงช test:
475
582
  - bundle exec pod install --project-directory=ios
476
583
  - bundle exec fastlane build
477
584
  cache:
478
- - key: app-yarn
585
+ - key: app-yarn-mr$CI_MERGE_REQUEST_IID
479
586
  policy: pull-push
480
587
  paths:
481
588
  - app/.yarn
482
- - key: app-node-modules
589
+ fallback_keys:
590
+ - app-yarn
591
+ - key: app-node-modules-mr$CI_MERGE_REQUEST_IID
483
592
  policy: pull-push
484
593
  paths:
485
594
  - app/node_modules
595
+ fallback_keys:
596
+ - app-node-modules
486
597
  - key:
487
598
  files:
488
599
  - app/Gemfile.lock
@@ -496,6 +607,7 @@ app ๐Ÿงช test:
496
607
  - app/dist
497
608
  exclude:
498
609
  - app/.env
610
+ - app/.next/cache/**/*
499
611
  expire_in: 1 day
500
612
  when: always
501
613
  reports: {}
@@ -584,15 +696,15 @@ app ๐Ÿงช test:
584
696
  - when: on_success
585
697
  if: $CI_MERGE_REQUEST_ID
586
698
  needs:
587
- - job: app ๐Ÿ‘ฎ lint
699
+ - job: 'app ๐Ÿ‘ฎ lint | review '
588
700
  artifacts: false
589
701
  - job: 'app ๐Ÿ”จ app | review '
590
702
  artifacts: true
591
- - job: app ๐Ÿงช test
703
+ - job: 'app ๐Ÿงช test | review '
592
704
  artifacts: false
593
705
  - job: 'app ๐Ÿงพ sbom | review '
594
706
  artifacts: true
595
- - job: app ๐Ÿ›ก audit
707
+ - job: 'app ๐Ÿ›ก audit | review '
596
708
  artifacts: false
597
709
  retry: *a1
598
710
  interruptible: true
@@ -683,6 +795,7 @@ app ๐Ÿงช test:
683
795
  - app/dist
684
796
  exclude:
685
797
  - app/.env
798
+ - app/.next/cache/**/*
686
799
  expire_in: 1 day
687
800
  when: always
688
801
  reports: {}
@@ -864,6 +977,7 @@ app ๐Ÿงช test:
864
977
  - app/dist
865
978
  exclude:
866
979
  - app/.env
980
+ - app/.next/cache/**/*
867
981
  expire_in: 1 day
868
982
  when: always
869
983
  reports: {}
@@ -959,7 +1073,7 @@ app ๐Ÿงช test:
959
1073
  retry: *a1
960
1074
  interruptible: true
961
1075
  allow_failure: true
962
- api ๐Ÿ›ก audit:
1076
+ 'api ๐Ÿ›ก audit | dev ':
963
1077
  stage: test
964
1078
  image: path/to/docker/jobs-default:the-version
965
1079
  variables:
@@ -976,14 +1090,11 @@ api ๐Ÿ›ก audit:
976
1090
  - when: never
977
1091
  if: $CI_PIPELINE_SOURCE == "trigger"
978
1092
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
979
- - when: never
980
- if: $CI_PIPELINE_SOURCE == "trigger"
981
- - if: $CI_MERGE_REQUEST_ID
982
1093
  needs: []
983
1094
  retry: *a1
984
1095
  interruptible: true
985
1096
  allow_failure: true
986
- api ๐Ÿ‘ฎ lint:
1097
+ 'api ๐Ÿ‘ฎ lint | dev ':
987
1098
  stage: test
988
1099
  image: path/to/docker/jobs-default:the-version
989
1100
  variables:
@@ -1020,13 +1131,10 @@ api ๐Ÿ‘ฎ lint:
1020
1131
  - when: never
1021
1132
  if: $CI_PIPELINE_SOURCE == "trigger"
1022
1133
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
1023
- - when: never
1024
- if: $CI_PIPELINE_SOURCE == "trigger"
1025
- - if: $CI_MERGE_REQUEST_ID
1026
1134
  needs: []
1027
1135
  retry: *a1
1028
1136
  interruptible: true
1029
- api ๐Ÿงช test:
1137
+ 'api ๐Ÿงช test | dev ':
1030
1138
  stage: test
1031
1139
  image: path/to/docker/jobs-testing-chrome:the-version
1032
1140
  variables:
@@ -1063,9 +1171,6 @@ api ๐Ÿงช test:
1063
1171
  - when: never
1064
1172
  if: $CI_PIPELINE_SOURCE == "trigger"
1065
1173
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
1066
- - when: never
1067
- if: $CI_PIPELINE_SOURCE == "trigger"
1068
- - if: $CI_MERGE_REQUEST_ID
1069
1174
  needs: []
1070
1175
  retry: *a1
1071
1176
  interruptible: true
@@ -1141,6 +1246,7 @@ api ๐Ÿงช test:
1141
1246
  - api/dist
1142
1247
  exclude:
1143
1248
  - api/.env
1249
+ - api/.next/cache/**/*
1144
1250
  expire_in: 1 day
1145
1251
  when: always
1146
1252
  reports: {}
@@ -1329,17 +1435,17 @@ api ๐Ÿงช test:
1329
1435
  - when: on_success
1330
1436
  if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/
1331
1437
  needs:
1332
- - job: api ๐Ÿ‘ฎ lint
1438
+ - job: 'api ๐Ÿ‘ฎ lint | dev '
1333
1439
  artifacts: false
1334
1440
  - job: 'api ๐Ÿ”จ app | dev '
1335
1441
  artifacts: false
1336
1442
  - job: 'api ๐Ÿ”จ docker | dev '
1337
1443
  artifacts: false
1338
- - job: api ๐Ÿงช test
1444
+ - job: 'api ๐Ÿงช test | dev '
1339
1445
  artifacts: false
1340
1446
  - job: 'api ๐Ÿงพ sbom | dev '
1341
1447
  artifacts: true
1342
- - job: api ๐Ÿ›ก audit
1448
+ - job: 'api ๐Ÿ›ก audit | dev '
1343
1449
  artifacts: false
1344
1450
  retry: *a1
1345
1451
  interruptible: true
@@ -1378,6 +1484,115 @@ api ๐Ÿงช test:
1378
1484
  retry: *a1
1379
1485
  interruptible: true
1380
1486
  allow_failure: true
1487
+ 'api ๐Ÿ›ก audit | review ':
1488
+ stage: test
1489
+ image: path/to/docker/jobs-default:the-version
1490
+ variables:
1491
+ KUBERNETES_CPU_REQUEST: '0.45'
1492
+ KUBERNETES_MEMORY_REQUEST: 1Gi
1493
+ KUBERNETES_MEMORY_LIMIT: 4Gi
1494
+ script:
1495
+ - collapseable_section_start "injectvars" "Injecting variables"
1496
+ - export APP_PATH="api"
1497
+ - collapseable_section_end "injectvars"
1498
+ - cd api
1499
+ - yarn npm audit --environment production
1500
+ rules:
1501
+ - when: never
1502
+ if: $CI_PIPELINE_SOURCE == "trigger"
1503
+ - if: $CI_MERGE_REQUEST_ID
1504
+ needs: []
1505
+ retry: *a1
1506
+ interruptible: true
1507
+ allow_failure: true
1508
+ 'api ๐Ÿ‘ฎ lint | review ':
1509
+ stage: test
1510
+ image: path/to/docker/jobs-default:the-version
1511
+ variables:
1512
+ KUBERNETES_CPU_REQUEST: '0.45'
1513
+ KUBERNETES_MEMORY_REQUEST: 1Gi
1514
+ KUBERNETES_MEMORY_LIMIT: 4Gi
1515
+ script:
1516
+ - collapseable_section_start "injectvars" "Injecting variables"
1517
+ - export APP_PATH="api"
1518
+ - collapseable_section_end "injectvars"
1519
+ - collapseable_section_start "nodeinstall" "Ensure node version"
1520
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
1521
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
1522
+ - collapseable_section_end "nodeinstall"
1523
+ - cd api
1524
+ - collapseable_section_start "nodeinstall" "Ensure node version"
1525
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
1526
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
1527
+ - collapseable_section_end "nodeinstall"
1528
+ - collapseable_section_start "yarninstall" "Yarn install"
1529
+ - yarn install --immutable
1530
+ - collapseable_section_end "yarninstall"
1531
+ - yarn lint
1532
+ cache:
1533
+ - key: api-yarn-mr$CI_MERGE_REQUEST_IID
1534
+ policy: pull-push
1535
+ paths:
1536
+ - api/.yarn
1537
+ fallback_keys:
1538
+ - api-yarn
1539
+ - key: api-node-modules-mr$CI_MERGE_REQUEST_IID
1540
+ policy: pull-push
1541
+ paths:
1542
+ - api/node_modules
1543
+ fallback_keys:
1544
+ - api-node-modules
1545
+ rules:
1546
+ - when: never
1547
+ if: $CI_PIPELINE_SOURCE == "trigger"
1548
+ - if: $CI_MERGE_REQUEST_ID
1549
+ needs: []
1550
+ retry: *a1
1551
+ interruptible: true
1552
+ 'api ๐Ÿงช test | review ':
1553
+ stage: test
1554
+ image: path/to/docker/jobs-testing-chrome:the-version
1555
+ variables:
1556
+ KUBERNETES_CPU_REQUEST: '0.45'
1557
+ KUBERNETES_MEMORY_REQUEST: 1Gi
1558
+ KUBERNETES_MEMORY_LIMIT: 4Gi
1559
+ script:
1560
+ - collapseable_section_start "injectvars" "Injecting variables"
1561
+ - export APP_PATH="api"
1562
+ - collapseable_section_end "injectvars"
1563
+ - collapseable_section_start "nodeinstall" "Ensure node version"
1564
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
1565
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
1566
+ - collapseable_section_end "nodeinstall"
1567
+ - cd api
1568
+ - collapseable_section_start "nodeinstall" "Ensure node version"
1569
+ - if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi
1570
+ - if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi
1571
+ - collapseable_section_end "nodeinstall"
1572
+ - collapseable_section_start "yarninstall" "Yarn install"
1573
+ - yarn install --immutable
1574
+ - collapseable_section_end "yarninstall"
1575
+ - yarn test
1576
+ cache:
1577
+ - key: api-yarn-mr$CI_MERGE_REQUEST_IID
1578
+ policy: pull-push
1579
+ paths:
1580
+ - api/.yarn
1581
+ fallback_keys:
1582
+ - api-yarn
1583
+ - key: api-node-modules-mr$CI_MERGE_REQUEST_IID
1584
+ policy: pull-push
1585
+ paths:
1586
+ - api/node_modules
1587
+ fallback_keys:
1588
+ - api-node-modules
1589
+ rules:
1590
+ - when: never
1591
+ if: $CI_PIPELINE_SOURCE == "trigger"
1592
+ - if: $CI_MERGE_REQUEST_ID
1593
+ needs: []
1594
+ retry: *a1
1595
+ interruptible: true
1381
1596
  'api ๐Ÿ”จ app | review ':
1382
1597
  stage: build
1383
1598
  image: path/to/docker/jobs-default:the-version
@@ -1435,14 +1650,18 @@ api ๐Ÿงช test:
1435
1650
  - collapseable_section_end "yarninstall"
1436
1651
  - yarn build
1437
1652
  cache:
1438
- - key: api-yarn
1653
+ - key: api-yarn-mr$CI_MERGE_REQUEST_IID
1439
1654
  policy: pull-push
1440
1655
  paths:
1441
1656
  - api/.yarn
1442
- - key: api-node-modules
1657
+ fallback_keys:
1658
+ - api-yarn
1659
+ - key: api-node-modules-mr$CI_MERGE_REQUEST_IID
1443
1660
  policy: pull-push
1444
1661
  paths:
1445
1662
  - api/node_modules
1663
+ fallback_keys:
1664
+ - api-node-modules
1446
1665
  artifacts:
1447
1666
  paths:
1448
1667
  - api/__build_info.json
@@ -1450,6 +1669,7 @@ api ๐Ÿงช test:
1450
1669
  - api/dist
1451
1670
  exclude:
1452
1671
  - api/.env
1672
+ - api/.next/cache/**/*
1453
1673
  expire_in: 1 day
1454
1674
  when: always
1455
1675
  reports: {}
@@ -1508,10 +1728,12 @@ api ๐Ÿงช test:
1508
1728
  - docker push $DOCKER_CACHE_IMAGE
1509
1729
  - collapseable_section_end "docker-push"
1510
1730
  cache:
1511
- - key: api-yarn
1731
+ - key: api-yarn-mr$CI_MERGE_REQUEST_IID
1512
1732
  policy: pull
1513
1733
  paths:
1514
1734
  - api/.yarn
1735
+ fallback_keys:
1736
+ - api-yarn
1515
1737
  rules:
1516
1738
  - when: never
1517
1739
  if: $CI_PIPELINE_SOURCE == "trigger"
@@ -1641,17 +1863,17 @@ api ๐Ÿงช test:
1641
1863
  - when: on_success
1642
1864
  if: $CI_MERGE_REQUEST_ID
1643
1865
  needs:
1644
- - job: api ๐Ÿ‘ฎ lint
1866
+ - job: 'api ๐Ÿ‘ฎ lint | review '
1645
1867
  artifacts: false
1646
1868
  - job: 'api ๐Ÿ”จ app | review '
1647
1869
  artifacts: false
1648
1870
  - job: 'api ๐Ÿ”จ docker | review '
1649
1871
  artifacts: false
1650
- - job: api ๐Ÿงช test
1872
+ - job: 'api ๐Ÿงช test | review '
1651
1873
  artifacts: false
1652
1874
  - job: 'api ๐Ÿงพ sbom | review '
1653
1875
  artifacts: true
1654
- - job: api ๐Ÿ›ก audit
1876
+ - job: 'api ๐Ÿ›ก audit | review '
1655
1877
  artifacts: false
1656
1878
  retry: *a1
1657
1879
  interruptible: true
@@ -1765,6 +1987,7 @@ api ๐Ÿงช test:
1765
1987
  - api/dist
1766
1988
  exclude:
1767
1989
  - api/.env
1990
+ - api/.next/cache/**/*
1768
1991
  expire_in: 1 day
1769
1992
  when: always
1770
1993
  reports: {}
@@ -2067,6 +2290,7 @@ api ๐Ÿงช test:
2067
2290
  - api/dist
2068
2291
  exclude:
2069
2292
  - api/.env
2293
+ - api/.next/cache/**/*
2070
2294
  expire_in: 1 day
2071
2295
  when: always
2072
2296
  reports: {}