@catladder/pipeline 1.163.1 → 1.164.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 (80) hide show
  1. package/dist/bundles/catladder-gitlab/index.js +1 -1
  2. package/dist/constants.js +1 -1
  3. package/dist/deploy/cloudRun/createJobs/cloudRunServices.js +2 -0
  4. package/dist/deploy/types/googleCloudRun.d.ts +8 -0
  5. package/dist/tsconfig.tsbuildinfo +1 -1
  6. package/examples/__snapshots__/cloud-run-memory-limit.test.ts.snap +0 -1958
  7. package/examples/__snapshots__/cloud-run-meteor-with-worker.test.ts.snap +1 -1935
  8. package/examples/__snapshots__/cloud-run-no-cpu-throttling.test.ts.snap +1 -1959
  9. package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +1 -2011
  10. package/examples/__snapshots__/cloud-run-non-public.test.ts.snap +1 -1959
  11. package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +1 -1970
  12. package/examples/__snapshots__/cloud-run-service-custom-vpc.test.ts.snap +1342 -0
  13. package/examples/__snapshots__/cloud-run-service-gen2.test.ts.snap +1 -1959
  14. package/examples/__snapshots__/cloud-run-service-increase-timout.test.ts.snap +1 -1959
  15. package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +1 -2003
  16. package/examples/__snapshots__/cloud-run-storybook.test.ts.snap +1 -1675
  17. package/examples/__snapshots__/cloud-run-with-ngnix.test.ts.snap +1 -1959
  18. package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +1 -3935
  19. package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +1 -3458
  20. package/examples/__snapshots__/cloud-run-with-worker.test.ts.snap +1 -1967
  21. package/examples/__snapshots__/custom-build-job-with-tests.test.ts.snap +1 -1787
  22. package/examples/__snapshots__/custom-build-job.test.ts.snap +1 -1487
  23. package/examples/__snapshots__/custom-deploy.test.ts.snap +1 -1721
  24. package/examples/__snapshots__/custom-envs.test.ts.snap +1 -1175
  25. package/examples/__snapshots__/custom-sbom-java.test.ts.snap +1 -1495
  26. package/examples/__snapshots__/git-submodule.test.ts.snap +1 -1962
  27. package/examples/__snapshots__/kubernetes-application-customization.test.ts.snap +1 -2450
  28. package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.test.ts.snap +1 -2462
  29. package/examples/__snapshots__/kubernetes-with-cloud-sql.test.ts.snap +1 -2470
  30. package/examples/__snapshots__/kubernetes-with-jobs.test.ts.snap +1 -4558
  31. package/examples/__snapshots__/kubernetes-with-mongodb.test.ts.snap +1 -2574
  32. package/examples/__snapshots__/local-dot-env.test.ts.snap +1 -1959
  33. package/examples/__snapshots__/meteor-kubernetes.test.ts.snap +1 -2503
  34. package/examples/__snapshots__/multiline-var.test.ts.snap +1 -4488
  35. package/examples/__snapshots__/native-app.test.ts.snap +1 -3167
  36. package/examples/__snapshots__/node-build-with-custom-image.test.ts.snap +1 -1959
  37. package/examples/__snapshots__/node-build-with-docker-additions.test.ts.snap +1 -1967
  38. package/examples/__snapshots__/rails-k8s-with-worker-dockerfile.test.ts.snap +1479 -2003
  39. package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +1 -1995
  40. package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +1 -2105
  41. package/examples/cloud-run-memory-limit.test.ts +1 -8
  42. package/examples/cloud-run-meteor-with-worker.test.ts +2 -9
  43. package/examples/cloud-run-no-cpu-throttling.test.ts +2 -9
  44. package/examples/cloud-run-no-service.test.ts +2 -9
  45. package/examples/cloud-run-non-public.test.ts +2 -9
  46. package/examples/cloud-run-post-stop-job.test.ts +2 -9
  47. package/examples/cloud-run-service-custom-vpc.test.ts +11 -0
  48. package/examples/cloud-run-service-custom-vpc.ts +30 -0
  49. package/examples/cloud-run-service-gen2.test.ts +2 -9
  50. package/examples/cloud-run-service-increase-timout.test.ts +2 -9
  51. package/examples/cloud-run-service-with-volumes.test.ts +2 -9
  52. package/examples/cloud-run-storybook.test.ts +2 -9
  53. package/examples/cloud-run-with-ngnix.test.ts +2 -9
  54. package/examples/cloud-run-with-sql-reuse-db.test.ts +2 -9
  55. package/examples/cloud-run-with-sql.test.ts +2 -9
  56. package/examples/cloud-run-with-worker.test.ts +2 -9
  57. package/examples/custom-build-job-with-tests.test.ts +2 -9
  58. package/examples/custom-build-job.test.ts +2 -9
  59. package/examples/custom-deploy.test.ts +2 -9
  60. package/examples/custom-envs.test.ts +2 -9
  61. package/examples/custom-sbom-java.test.ts +2 -9
  62. package/examples/git-submodule.test.ts +2 -9
  63. package/examples/kubernetes-application-customization.test.ts +2 -9
  64. package/examples/kubernetes-with-cloud-sql-legacy.test.ts +2 -9
  65. package/examples/kubernetes-with-cloud-sql.test.ts +2 -9
  66. package/examples/kubernetes-with-jobs.test.ts +2 -9
  67. package/examples/kubernetes-with-mongodb.test.ts +2 -9
  68. package/examples/local-dot-env.test.ts +2 -9
  69. package/examples/meteor-kubernetes.test.ts +2 -9
  70. package/examples/multiline-var.test.ts +2 -9
  71. package/examples/native-app.test.ts +2 -9
  72. package/examples/node-build-with-custom-image.test.ts +2 -9
  73. package/examples/node-build-with-docker-additions.test.ts +2 -9
  74. package/examples/rails-k8s-with-worker-dockerfile.test.ts +2 -2
  75. package/examples/rails-k8s-with-worker.test.ts +2 -9
  76. package/examples/wait-for-other-deploy.test.ts +2 -9
  77. package/package.json +1 -1
  78. package/scripts/generate-examples-test.ts +3 -5
  79. package/src/deploy/cloudRun/createJobs/cloudRunServices.ts +2 -0
  80. package/src/deploy/types/googleCloudRun.ts +9 -0
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`matches snapshot for cloud-run-memory-limit local pipeline YAML 1`] = `
3
+ exports[`matches snapshot for wait-for-other-deploy local pipeline YAML 1`] = `
4
4
  "image: path/to/docker/jobs-default:the-version
5
5
  stages:
6
6
  - setup
@@ -1274,2107 +1274,3 @@ create release:
1274
1274
  needs: []
1275
1275
  "
1276
1276
  `;
1277
-
1278
- exports[`matches snapshot for wait-for-other-deploy 1`] = `
1279
- {
1280
- "mainBranch": {
1281
- "image": "path/to/docker/jobs-default:the-version",
1282
- "jobs": {
1283
- "api 👮 lint": {
1284
- "cache": [
1285
- {
1286
- "key": "api-yarn",
1287
- "paths": [
1288
- "api/.yarn",
1289
- ],
1290
- "policy": "pull-push",
1291
- },
1292
- {
1293
- "key": "api-node-modules",
1294
- "paths": [
1295
- "api/node_modules",
1296
- ],
1297
- "policy": "pull-push",
1298
- },
1299
- ],
1300
- "image": "path/to/docker/jobs-default:the-version",
1301
- "interruptible": true,
1302
- "needs": [],
1303
- "retry": {
1304
- "max": 2,
1305
- "when": [
1306
- "runner_system_failure",
1307
- "stuck_or_timeout_failure",
1308
- ],
1309
- },
1310
- "script": [
1311
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
1312
- "export APP_PATH="api"",
1313
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
1314
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
1315
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
1316
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
1317
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
1318
- "cd api",
1319
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
1320
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
1321
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
1322
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
1323
- "echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"",
1324
- "yarn install --immutable",
1325
- "echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"",
1326
- "yarn lint",
1327
- ],
1328
- "stage": "test",
1329
- "variables": {
1330
- "KUBERNETES_CPU_REQUEST": "0.45",
1331
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
1332
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
1333
- },
1334
- },
1335
- "api 🔨 app | dev ": {
1336
- "artifacts": {
1337
- "expire_in": "1 day",
1338
- "paths": [
1339
- "api/__build_info.json",
1340
- "api/.next",
1341
- "api/dist",
1342
- ],
1343
- "reports": {
1344
- "junit": undefined,
1345
- },
1346
- "when": "always",
1347
- },
1348
- "cache": [
1349
- {
1350
- "key": "api-yarn",
1351
- "paths": [
1352
- "api/.yarn",
1353
- ],
1354
- "policy": "pull-push",
1355
- },
1356
- {
1357
- "key": "api-node-modules",
1358
- "paths": [
1359
- "api/node_modules",
1360
- ],
1361
- "policy": "pull-push",
1362
- },
1363
- {
1364
- "key": "api-next-cache",
1365
- "paths": [
1366
- "api/.next/cache",
1367
- ],
1368
- "policy": "pull-push",
1369
- },
1370
- ],
1371
- "image": "path/to/docker/jobs-default:the-version",
1372
- "interruptible": true,
1373
- "needs": [],
1374
- "retry": {
1375
- "max": 2,
1376
- "when": [
1377
- "runner_system_failure",
1378
- "stuck_or_timeout_failure",
1379
- ],
1380
- },
1381
- "script": [
1382
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
1383
- "export ENV_SHORT="dev"",
1384
- "export APP_DIR="api"",
1385
- "export ENV_TYPE="dev"",
1386
- "export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"",
1387
- "export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"",
1388
- "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")"",
1389
- "export HOST="unknown-host.example.com"",
1390
- "export ROOT_URL="https://unknown-host.example.com"",
1391
- "export HOST_INTERNAL="unknown-host.example.com"",
1392
- "export HOST_CANONICAL="unknown-host.example.com"",
1393
- "export ROOT_URL_INTERNAL="https://unknown-host.example.com"",
1394
- "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\\"]"",
1395
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
1396
- "echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > api/__build_info.json",
1397
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
1398
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
1399
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
1400
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
1401
- "cd api",
1402
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
1403
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
1404
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
1405
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
1406
- "echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"",
1407
- "yarn install --immutable",
1408
- "echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"",
1409
- "yarn build",
1410
- ],
1411
- "stage": "build",
1412
- "variables": {
1413
- "KUBERNETES_CPU_REQUEST": "0.45",
1414
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
1415
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
1416
- },
1417
- },
1418
- "api 🚀 Deploy | dev ": {
1419
- "allow_failure": false,
1420
- "cache": [],
1421
- "image": "path/to/docker/jobs-default:the-version",
1422
- "interruptible": true,
1423
- "needs": [
1424
- {
1425
- "artifacts": false,
1426
- "job": "api 👮 lint",
1427
- },
1428
- {
1429
- "artifacts": true,
1430
- "job": "api 🔨 app | dev ",
1431
- },
1432
- {
1433
- "artifacts": false,
1434
- "job": "api 🧪 test",
1435
- },
1436
- {
1437
- "artifacts": true,
1438
- "job": "api 🧾 sbom | dev ",
1439
- },
1440
- {
1441
- "artifacts": false,
1442
- "job": "api 🛡 audit",
1443
- },
1444
- ],
1445
- "retry": {
1446
- "max": 2,
1447
- "when": [
1448
- "runner_system_failure",
1449
- "stuck_or_timeout_failure",
1450
- ],
1451
- },
1452
- "rules": [
1453
- {
1454
- "when": "on_success",
1455
- },
1456
- ],
1457
- "script": [
1458
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
1459
- "export ENV_SHORT="dev"",
1460
- "export APP_DIR="api"",
1461
- "export ENV_TYPE="dev"",
1462
- "export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"",
1463
- "export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"",
1464
- "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")"",
1465
- "export HOST="unknown-host.example.com"",
1466
- "export ROOT_URL="https://unknown-host.example.com"",
1467
- "export HOST_INTERNAL="unknown-host.example.com"",
1468
- "export HOST_CANONICAL="unknown-host.example.com"",
1469
- "export ROOT_URL_INTERNAL="https://unknown-host.example.com"",
1470
- "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\\"]"",
1471
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
1472
- "cd api",
1473
- "yarn deploy",
1474
- "echo 'Uploading SBOM to Dependency Track'",
1475
- "/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/api" "https://unknown-host.example.com" "__sbom.json" vex.json || true",
1476
- ],
1477
- "stage": "deploy dev",
1478
- "variables": {
1479
- "KUBERNETES_CPU_REQUEST": "0.22",
1480
- "KUBERNETES_MEMORY_LIMIT": "400Mi",
1481
- "KUBERNETES_MEMORY_REQUEST": "200Mi",
1482
- },
1483
- },
1484
- "api 🛡 audit": {
1485
- "allow_failure": true,
1486
- "image": "path/to/docker/jobs-default:the-version",
1487
- "interruptible": true,
1488
- "needs": [],
1489
- "retry": {
1490
- "max": 2,
1491
- "when": [
1492
- "runner_system_failure",
1493
- "stuck_or_timeout_failure",
1494
- ],
1495
- },
1496
- "script": [
1497
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
1498
- "export APP_PATH="api"",
1499
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
1500
- "cd api",
1501
- "yarn npm audit --environment production",
1502
- ],
1503
- "stage": "test",
1504
- "variables": {
1505
- "KUBERNETES_CPU_REQUEST": "0.45",
1506
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
1507
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
1508
- },
1509
- },
1510
- "api 🧪 test": {
1511
- "cache": [
1512
- {
1513
- "key": "api-yarn",
1514
- "paths": [
1515
- "api/.yarn",
1516
- ],
1517
- "policy": "pull-push",
1518
- },
1519
- {
1520
- "key": "api-node-modules",
1521
- "paths": [
1522
- "api/node_modules",
1523
- ],
1524
- "policy": "pull-push",
1525
- },
1526
- ],
1527
- "image": "path/to/docker/jobs-testing-chrome:the-version",
1528
- "interruptible": true,
1529
- "needs": [],
1530
- "retry": {
1531
- "max": 2,
1532
- "when": [
1533
- "runner_system_failure",
1534
- "stuck_or_timeout_failure",
1535
- ],
1536
- },
1537
- "script": [
1538
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
1539
- "export APP_PATH="api"",
1540
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
1541
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
1542
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
1543
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
1544
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
1545
- "cd api",
1546
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
1547
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
1548
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
1549
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
1550
- "echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"",
1551
- "yarn install --immutable",
1552
- "echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"",
1553
- "yarn test",
1554
- ],
1555
- "stage": "test",
1556
- "variables": {
1557
- "KUBERNETES_CPU_REQUEST": "0.45",
1558
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
1559
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
1560
- },
1561
- },
1562
- "api 🧾 sbom | dev ": {
1563
- "allow_failure": true,
1564
- "artifacts": {
1565
- "paths": [
1566
- "__sbom.json",
1567
- ],
1568
- },
1569
- "image": "aquasec/trivy:0.38.3",
1570
- "interruptible": true,
1571
- "needs": [],
1572
- "retry": {
1573
- "max": 2,
1574
- "when": [
1575
- "runner_system_failure",
1576
- "stuck_or_timeout_failure",
1577
- ],
1578
- },
1579
- "script": [
1580
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
1581
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
1582
- "trivy fs --quiet --format cyclonedx --output "__sbom.json" api",
1583
- ],
1584
- "stage": "build",
1585
- "variables": {},
1586
- },
1587
- "www 👮 lint": {
1588
- "cache": [
1589
- {
1590
- "key": "www-yarn",
1591
- "paths": [
1592
- "www/.yarn",
1593
- ],
1594
- "policy": "pull-push",
1595
- },
1596
- {
1597
- "key": "www-node-modules",
1598
- "paths": [
1599
- "www/node_modules",
1600
- ],
1601
- "policy": "pull-push",
1602
- },
1603
- ],
1604
- "image": "path/to/docker/jobs-default:the-version",
1605
- "interruptible": true,
1606
- "needs": [],
1607
- "retry": {
1608
- "max": 2,
1609
- "when": [
1610
- "runner_system_failure",
1611
- "stuck_or_timeout_failure",
1612
- ],
1613
- },
1614
- "script": [
1615
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
1616
- "export APP_PATH="www"",
1617
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
1618
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
1619
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
1620
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
1621
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
1622
- "cd www",
1623
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
1624
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
1625
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
1626
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
1627
- "echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"",
1628
- "yarn install --immutable",
1629
- "echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"",
1630
- "yarn lint",
1631
- ],
1632
- "stage": "test",
1633
- "variables": {
1634
- "KUBERNETES_CPU_REQUEST": "0.45",
1635
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
1636
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
1637
- },
1638
- },
1639
- "www 🔨 app | dev ": {
1640
- "artifacts": {
1641
- "expire_in": "1 day",
1642
- "paths": [
1643
- "www/__build_info.json",
1644
- "www/.next",
1645
- "www/dist",
1646
- ],
1647
- "reports": {
1648
- "junit": undefined,
1649
- },
1650
- "when": "always",
1651
- },
1652
- "cache": [
1653
- {
1654
- "key": "www-yarn",
1655
- "paths": [
1656
- "www/.yarn",
1657
- ],
1658
- "policy": "pull-push",
1659
- },
1660
- {
1661
- "key": "www-node-modules",
1662
- "paths": [
1663
- "www/node_modules",
1664
- ],
1665
- "policy": "pull-push",
1666
- },
1667
- {
1668
- "key": "www-next-cache",
1669
- "paths": [
1670
- "www/.next/cache",
1671
- ],
1672
- "policy": "pull-push",
1673
- },
1674
- ],
1675
- "image": "path/to/docker/jobs-default:the-version",
1676
- "interruptible": true,
1677
- "needs": [],
1678
- "retry": {
1679
- "max": 2,
1680
- "when": [
1681
- "runner_system_failure",
1682
- "stuck_or_timeout_failure",
1683
- ],
1684
- },
1685
- "script": [
1686
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
1687
- "export ENV_SHORT="dev"",
1688
- "export APP_DIR="www"",
1689
- "export ENV_TYPE="dev"",
1690
- "export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"",
1691
- "export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"",
1692
- "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")"",
1693
- "export HOST="unknown-host.example.com"",
1694
- "export ROOT_URL="https://unknown-host.example.com"",
1695
- "export HOST_INTERNAL="unknown-host.example.com"",
1696
- "export HOST_CANONICAL="unknown-host.example.com"",
1697
- "export ROOT_URL_INTERNAL="https://unknown-host.example.com"",
1698
- "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\\"]"",
1699
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
1700
- "echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > www/__build_info.json",
1701
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
1702
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
1703
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
1704
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
1705
- "cd www",
1706
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
1707
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
1708
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
1709
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
1710
- "echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"",
1711
- "yarn install --immutable",
1712
- "echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"",
1713
- "yarn build",
1714
- ],
1715
- "stage": "build",
1716
- "variables": {
1717
- "KUBERNETES_CPU_REQUEST": "0.45",
1718
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
1719
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
1720
- },
1721
- },
1722
- "www 🚀 Deploy | dev ": {
1723
- "allow_failure": false,
1724
- "cache": [],
1725
- "image": "path/to/docker/jobs-default:the-version",
1726
- "interruptible": true,
1727
- "needs": [
1728
- {
1729
- "artifacts": false,
1730
- "job": "api 🚀 Deploy | dev ",
1731
- },
1732
- {
1733
- "artifacts": false,
1734
- "job": "www 👮 lint",
1735
- },
1736
- {
1737
- "artifacts": true,
1738
- "job": "www 🔨 app | dev ",
1739
- },
1740
- {
1741
- "artifacts": false,
1742
- "job": "www 🧪 test",
1743
- },
1744
- {
1745
- "artifacts": true,
1746
- "job": "www 🧾 sbom | dev ",
1747
- },
1748
- {
1749
- "artifacts": false,
1750
- "job": "www 🛡 audit",
1751
- },
1752
- ],
1753
- "retry": {
1754
- "max": 2,
1755
- "when": [
1756
- "runner_system_failure",
1757
- "stuck_or_timeout_failure",
1758
- ],
1759
- },
1760
- "rules": [
1761
- {
1762
- "when": "on_success",
1763
- },
1764
- ],
1765
- "script": [
1766
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
1767
- "export ENV_SHORT="dev"",
1768
- "export APP_DIR="www"",
1769
- "export ENV_TYPE="dev"",
1770
- "export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"",
1771
- "export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"",
1772
- "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")"",
1773
- "export HOST="unknown-host.example.com"",
1774
- "export ROOT_URL="https://unknown-host.example.com"",
1775
- "export HOST_INTERNAL="unknown-host.example.com"",
1776
- "export HOST_CANONICAL="unknown-host.example.com"",
1777
- "export ROOT_URL_INTERNAL="https://unknown-host.example.com"",
1778
- "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\\"]"",
1779
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
1780
- "cd www",
1781
- "yarn deploy",
1782
- "echo 'Uploading SBOM to Dependency Track'",
1783
- "/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/www" "https://unknown-host.example.com" "__sbom.json" vex.json || true",
1784
- ],
1785
- "stage": "deploy dev",
1786
- "variables": {
1787
- "KUBERNETES_CPU_REQUEST": "0.22",
1788
- "KUBERNETES_MEMORY_LIMIT": "400Mi",
1789
- "KUBERNETES_MEMORY_REQUEST": "200Mi",
1790
- },
1791
- },
1792
- "www 🛡 audit": {
1793
- "allow_failure": true,
1794
- "image": "path/to/docker/jobs-default:the-version",
1795
- "interruptible": true,
1796
- "needs": [],
1797
- "retry": {
1798
- "max": 2,
1799
- "when": [
1800
- "runner_system_failure",
1801
- "stuck_or_timeout_failure",
1802
- ],
1803
- },
1804
- "script": [
1805
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
1806
- "export APP_PATH="www"",
1807
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
1808
- "cd www",
1809
- "yarn npm audit --environment production",
1810
- ],
1811
- "stage": "test",
1812
- "variables": {
1813
- "KUBERNETES_CPU_REQUEST": "0.45",
1814
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
1815
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
1816
- },
1817
- },
1818
- "www 🧪 test": {
1819
- "cache": [
1820
- {
1821
- "key": "www-yarn",
1822
- "paths": [
1823
- "www/.yarn",
1824
- ],
1825
- "policy": "pull-push",
1826
- },
1827
- {
1828
- "key": "www-node-modules",
1829
- "paths": [
1830
- "www/node_modules",
1831
- ],
1832
- "policy": "pull-push",
1833
- },
1834
- ],
1835
- "image": "path/to/docker/jobs-testing-chrome:the-version",
1836
- "interruptible": true,
1837
- "needs": [],
1838
- "retry": {
1839
- "max": 2,
1840
- "when": [
1841
- "runner_system_failure",
1842
- "stuck_or_timeout_failure",
1843
- ],
1844
- },
1845
- "script": [
1846
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
1847
- "export APP_PATH="www"",
1848
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
1849
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
1850
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
1851
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
1852
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
1853
- "cd www",
1854
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
1855
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
1856
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
1857
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
1858
- "echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"",
1859
- "yarn install --immutable",
1860
- "echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"",
1861
- "yarn test",
1862
- ],
1863
- "stage": "test",
1864
- "variables": {
1865
- "KUBERNETES_CPU_REQUEST": "0.45",
1866
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
1867
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
1868
- },
1869
- },
1870
- "www 🧾 sbom | dev ": {
1871
- "allow_failure": true,
1872
- "artifacts": {
1873
- "paths": [
1874
- "__sbom.json",
1875
- ],
1876
- },
1877
- "image": "aquasec/trivy:0.38.3",
1878
- "interruptible": true,
1879
- "needs": [],
1880
- "retry": {
1881
- "max": 2,
1882
- "when": [
1883
- "runner_system_failure",
1884
- "stuck_or_timeout_failure",
1885
- ],
1886
- },
1887
- "script": [
1888
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
1889
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
1890
- "trivy fs --quiet --format cyclonedx --output "__sbom.json" www",
1891
- ],
1892
- "stage": "build",
1893
- "variables": {},
1894
- },
1895
- },
1896
- "stages": [
1897
- "setup",
1898
- "setup dev",
1899
- "setup review",
1900
- "setup stage",
1901
- "setup prod",
1902
- "test",
1903
- "test dev",
1904
- "test review",
1905
- "test stage",
1906
- "test prod",
1907
- "build",
1908
- "build dev",
1909
- "build review",
1910
- "build stage",
1911
- "build prod",
1912
- "deploy",
1913
- "deploy dev",
1914
- "deploy review",
1915
- "deploy stage",
1916
- "deploy prod",
1917
- "verify",
1918
- "verify dev",
1919
- "verify review",
1920
- "verify stage",
1921
- "verify prod",
1922
- "rollback",
1923
- "rollback dev",
1924
- "rollback review",
1925
- "rollback stage",
1926
- "rollback prod",
1927
- "stop",
1928
- "stop dev",
1929
- "stop review",
1930
- "stop stage",
1931
- "stop prod",
1932
- ],
1933
- "variables": {
1934
- "ARTIFACT_COMPRESSION_LEVEL": "fast",
1935
- "CACHE_COMPRESSION_LEVEL": "fast",
1936
- "FF_USE_FASTZIP": "true",
1937
- "GIT_DEPTH": "1",
1938
- "TRANSFER_METER_FREQUENCY": "5s",
1939
- },
1940
- "workflow": {
1941
- "rules": [
1942
- {
1943
- "if": "$CI_COMMIT_TAG",
1944
- },
1945
- {
1946
- "if": "$CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/",
1947
- "when": "never",
1948
- },
1949
- {
1950
- "if": "$CI_PIPELINE_SOURCE == "schedule"",
1951
- "when": "never",
1952
- },
1953
- {
1954
- "if": "$CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/",
1955
- },
1956
- {
1957
- "if": "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH",
1958
- },
1959
- {
1960
- "if": "$CI_MERGE_REQUEST_ID",
1961
- },
1962
- ],
1963
- },
1964
- },
1965
- "mr": {
1966
- "image": "path/to/docker/jobs-default:the-version",
1967
- "jobs": {
1968
- "api 👮 lint": {
1969
- "cache": [
1970
- {
1971
- "key": "api-yarn",
1972
- "paths": [
1973
- "api/.yarn",
1974
- ],
1975
- "policy": "pull-push",
1976
- },
1977
- {
1978
- "key": "api-node-modules",
1979
- "paths": [
1980
- "api/node_modules",
1981
- ],
1982
- "policy": "pull-push",
1983
- },
1984
- ],
1985
- "image": "path/to/docker/jobs-default:the-version",
1986
- "interruptible": true,
1987
- "needs": [],
1988
- "retry": {
1989
- "max": 2,
1990
- "when": [
1991
- "runner_system_failure",
1992
- "stuck_or_timeout_failure",
1993
- ],
1994
- },
1995
- "script": [
1996
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
1997
- "export APP_PATH="api"",
1998
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
1999
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
2000
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
2001
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
2002
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
2003
- "cd api",
2004
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
2005
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
2006
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
2007
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
2008
- "echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"",
2009
- "yarn install --immutable",
2010
- "echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"",
2011
- "yarn lint",
2012
- ],
2013
- "stage": "test",
2014
- "variables": {
2015
- "KUBERNETES_CPU_REQUEST": "0.45",
2016
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
2017
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
2018
- },
2019
- },
2020
- "api 🔨 app | review ": {
2021
- "artifacts": {
2022
- "expire_in": "1 day",
2023
- "paths": [
2024
- "api/__build_info.json",
2025
- "api/.next",
2026
- "api/dist",
2027
- ],
2028
- "reports": {
2029
- "junit": undefined,
2030
- },
2031
- "when": "always",
2032
- },
2033
- "cache": [
2034
- {
2035
- "key": "api-yarn",
2036
- "paths": [
2037
- "api/.yarn",
2038
- ],
2039
- "policy": "pull-push",
2040
- },
2041
- {
2042
- "key": "api-node-modules",
2043
- "paths": [
2044
- "api/node_modules",
2045
- ],
2046
- "policy": "pull-push",
2047
- },
2048
- {
2049
- "key": "api-next-cache",
2050
- "paths": [
2051
- "api/.next/cache",
2052
- ],
2053
- "policy": "pull-push",
2054
- },
2055
- ],
2056
- "image": "path/to/docker/jobs-default:the-version",
2057
- "interruptible": true,
2058
- "needs": [],
2059
- "retry": {
2060
- "max": 2,
2061
- "when": [
2062
- "runner_system_failure",
2063
- "stuck_or_timeout_failure",
2064
- ],
2065
- },
2066
- "script": [
2067
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
2068
- "export ENV_SHORT="review"",
2069
- "export APP_DIR="api"",
2070
- "export ENV_TYPE="review"",
2071
- "export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"",
2072
- "export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"",
2073
- "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")"",
2074
- "export HOST="unknown-host.example.com"",
2075
- "export ROOT_URL="https://unknown-host.example.com"",
2076
- "export HOST_INTERNAL="unknown-host.example.com"",
2077
- "export HOST_CANONICAL="unknown-host.example.com"",
2078
- "export ROOT_URL_INTERNAL="https://unknown-host.example.com"",
2079
- "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\\"]"",
2080
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
2081
- "echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > api/__build_info.json",
2082
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
2083
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
2084
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
2085
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
2086
- "cd api",
2087
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
2088
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
2089
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
2090
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
2091
- "echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"",
2092
- "yarn install --immutable",
2093
- "echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"",
2094
- "yarn build",
2095
- ],
2096
- "stage": "build",
2097
- "variables": {
2098
- "KUBERNETES_CPU_REQUEST": "0.45",
2099
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
2100
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
2101
- },
2102
- },
2103
- "api 🚀 Deploy | review ": {
2104
- "allow_failure": false,
2105
- "cache": [],
2106
- "image": "path/to/docker/jobs-default:the-version",
2107
- "interruptible": true,
2108
- "needs": [
2109
- {
2110
- "artifacts": false,
2111
- "job": "api 👮 lint",
2112
- },
2113
- {
2114
- "artifacts": true,
2115
- "job": "api 🔨 app | review ",
2116
- },
2117
- {
2118
- "artifacts": false,
2119
- "job": "api 🧪 test",
2120
- },
2121
- {
2122
- "artifacts": true,
2123
- "job": "api 🧾 sbom | review ",
2124
- },
2125
- {
2126
- "artifacts": false,
2127
- "job": "api 🛡 audit",
2128
- },
2129
- ],
2130
- "retry": {
2131
- "max": 2,
2132
- "when": [
2133
- "runner_system_failure",
2134
- "stuck_or_timeout_failure",
2135
- ],
2136
- },
2137
- "rules": [
2138
- {
2139
- "when": "on_success",
2140
- },
2141
- ],
2142
- "script": [
2143
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
2144
- "export ENV_SHORT="review"",
2145
- "export APP_DIR="api"",
2146
- "export ENV_TYPE="review"",
2147
- "export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"",
2148
- "export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"",
2149
- "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")"",
2150
- "export HOST="unknown-host.example.com"",
2151
- "export ROOT_URL="https://unknown-host.example.com"",
2152
- "export HOST_INTERNAL="unknown-host.example.com"",
2153
- "export HOST_CANONICAL="unknown-host.example.com"",
2154
- "export ROOT_URL_INTERNAL="https://unknown-host.example.com"",
2155
- "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\\"]"",
2156
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
2157
- "cd api",
2158
- "yarn deploy",
2159
- "echo 'Uploading SBOM to Dependency Track'",
2160
- "/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/api" "https://unknown-host.example.com" "__sbom.json" vex.json || true",
2161
- ],
2162
- "stage": "deploy review",
2163
- "variables": {
2164
- "KUBERNETES_CPU_REQUEST": "0.22",
2165
- "KUBERNETES_MEMORY_LIMIT": "400Mi",
2166
- "KUBERNETES_MEMORY_REQUEST": "200Mi",
2167
- },
2168
- },
2169
- "api 🛡 audit": {
2170
- "allow_failure": true,
2171
- "image": "path/to/docker/jobs-default:the-version",
2172
- "interruptible": true,
2173
- "needs": [],
2174
- "retry": {
2175
- "max": 2,
2176
- "when": [
2177
- "runner_system_failure",
2178
- "stuck_or_timeout_failure",
2179
- ],
2180
- },
2181
- "script": [
2182
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
2183
- "export APP_PATH="api"",
2184
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
2185
- "cd api",
2186
- "yarn npm audit --environment production",
2187
- ],
2188
- "stage": "test",
2189
- "variables": {
2190
- "KUBERNETES_CPU_REQUEST": "0.45",
2191
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
2192
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
2193
- },
2194
- },
2195
- "api 🧪 test": {
2196
- "cache": [
2197
- {
2198
- "key": "api-yarn",
2199
- "paths": [
2200
- "api/.yarn",
2201
- ],
2202
- "policy": "pull-push",
2203
- },
2204
- {
2205
- "key": "api-node-modules",
2206
- "paths": [
2207
- "api/node_modules",
2208
- ],
2209
- "policy": "pull-push",
2210
- },
2211
- ],
2212
- "image": "path/to/docker/jobs-testing-chrome:the-version",
2213
- "interruptible": true,
2214
- "needs": [],
2215
- "retry": {
2216
- "max": 2,
2217
- "when": [
2218
- "runner_system_failure",
2219
- "stuck_or_timeout_failure",
2220
- ],
2221
- },
2222
- "script": [
2223
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
2224
- "export APP_PATH="api"",
2225
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
2226
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
2227
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
2228
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
2229
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
2230
- "cd api",
2231
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
2232
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
2233
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
2234
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
2235
- "echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"",
2236
- "yarn install --immutable",
2237
- "echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"",
2238
- "yarn test",
2239
- ],
2240
- "stage": "test",
2241
- "variables": {
2242
- "KUBERNETES_CPU_REQUEST": "0.45",
2243
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
2244
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
2245
- },
2246
- },
2247
- "api 🧾 sbom | review ": {
2248
- "allow_failure": true,
2249
- "artifacts": {
2250
- "paths": [
2251
- "__sbom.json",
2252
- ],
2253
- },
2254
- "image": "aquasec/trivy:0.38.3",
2255
- "interruptible": true,
2256
- "needs": [],
2257
- "retry": {
2258
- "max": 2,
2259
- "when": [
2260
- "runner_system_failure",
2261
- "stuck_or_timeout_failure",
2262
- ],
2263
- },
2264
- "script": [
2265
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
2266
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
2267
- "trivy fs --quiet --format cyclonedx --output "__sbom.json" api",
2268
- ],
2269
- "stage": "build",
2270
- "variables": {},
2271
- },
2272
- "www 👮 lint": {
2273
- "cache": [
2274
- {
2275
- "key": "www-yarn",
2276
- "paths": [
2277
- "www/.yarn",
2278
- ],
2279
- "policy": "pull-push",
2280
- },
2281
- {
2282
- "key": "www-node-modules",
2283
- "paths": [
2284
- "www/node_modules",
2285
- ],
2286
- "policy": "pull-push",
2287
- },
2288
- ],
2289
- "image": "path/to/docker/jobs-default:the-version",
2290
- "interruptible": true,
2291
- "needs": [],
2292
- "retry": {
2293
- "max": 2,
2294
- "when": [
2295
- "runner_system_failure",
2296
- "stuck_or_timeout_failure",
2297
- ],
2298
- },
2299
- "script": [
2300
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
2301
- "export APP_PATH="www"",
2302
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
2303
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
2304
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
2305
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
2306
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
2307
- "cd www",
2308
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
2309
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
2310
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
2311
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
2312
- "echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"",
2313
- "yarn install --immutable",
2314
- "echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"",
2315
- "yarn lint",
2316
- ],
2317
- "stage": "test",
2318
- "variables": {
2319
- "KUBERNETES_CPU_REQUEST": "0.45",
2320
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
2321
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
2322
- },
2323
- },
2324
- "www 🔨 app | review ": {
2325
- "artifacts": {
2326
- "expire_in": "1 day",
2327
- "paths": [
2328
- "www/__build_info.json",
2329
- "www/.next",
2330
- "www/dist",
2331
- ],
2332
- "reports": {
2333
- "junit": undefined,
2334
- },
2335
- "when": "always",
2336
- },
2337
- "cache": [
2338
- {
2339
- "key": "www-yarn",
2340
- "paths": [
2341
- "www/.yarn",
2342
- ],
2343
- "policy": "pull-push",
2344
- },
2345
- {
2346
- "key": "www-node-modules",
2347
- "paths": [
2348
- "www/node_modules",
2349
- ],
2350
- "policy": "pull-push",
2351
- },
2352
- {
2353
- "key": "www-next-cache",
2354
- "paths": [
2355
- "www/.next/cache",
2356
- ],
2357
- "policy": "pull-push",
2358
- },
2359
- ],
2360
- "image": "path/to/docker/jobs-default:the-version",
2361
- "interruptible": true,
2362
- "needs": [],
2363
- "retry": {
2364
- "max": 2,
2365
- "when": [
2366
- "runner_system_failure",
2367
- "stuck_or_timeout_failure",
2368
- ],
2369
- },
2370
- "script": [
2371
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
2372
- "export ENV_SHORT="review"",
2373
- "export APP_DIR="www"",
2374
- "export ENV_TYPE="review"",
2375
- "export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"",
2376
- "export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"",
2377
- "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")"",
2378
- "export HOST="unknown-host.example.com"",
2379
- "export ROOT_URL="https://unknown-host.example.com"",
2380
- "export HOST_INTERNAL="unknown-host.example.com"",
2381
- "export HOST_CANONICAL="unknown-host.example.com"",
2382
- "export ROOT_URL_INTERNAL="https://unknown-host.example.com"",
2383
- "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\\"]"",
2384
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
2385
- "echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > www/__build_info.json",
2386
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
2387
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
2388
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
2389
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
2390
- "cd www",
2391
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
2392
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
2393
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
2394
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
2395
- "echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"",
2396
- "yarn install --immutable",
2397
- "echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"",
2398
- "yarn build",
2399
- ],
2400
- "stage": "build",
2401
- "variables": {
2402
- "KUBERNETES_CPU_REQUEST": "0.45",
2403
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
2404
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
2405
- },
2406
- },
2407
- "www 🚀 Deploy | review ": {
2408
- "allow_failure": false,
2409
- "cache": [],
2410
- "image": "path/to/docker/jobs-default:the-version",
2411
- "interruptible": true,
2412
- "needs": [
2413
- {
2414
- "artifacts": false,
2415
- "job": "api 🚀 Deploy | review ",
2416
- },
2417
- {
2418
- "artifacts": false,
2419
- "job": "www 👮 lint",
2420
- },
2421
- {
2422
- "artifacts": true,
2423
- "job": "www 🔨 app | review ",
2424
- },
2425
- {
2426
- "artifacts": false,
2427
- "job": "www 🧪 test",
2428
- },
2429
- {
2430
- "artifacts": true,
2431
- "job": "www 🧾 sbom | review ",
2432
- },
2433
- {
2434
- "artifacts": false,
2435
- "job": "www 🛡 audit",
2436
- },
2437
- ],
2438
- "retry": {
2439
- "max": 2,
2440
- "when": [
2441
- "runner_system_failure",
2442
- "stuck_or_timeout_failure",
2443
- ],
2444
- },
2445
- "rules": [
2446
- {
2447
- "when": "on_success",
2448
- },
2449
- ],
2450
- "script": [
2451
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
2452
- "export ENV_SHORT="review"",
2453
- "export APP_DIR="www"",
2454
- "export ENV_TYPE="review"",
2455
- "export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"",
2456
- "export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"",
2457
- "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")"",
2458
- "export HOST="unknown-host.example.com"",
2459
- "export ROOT_URL="https://unknown-host.example.com"",
2460
- "export HOST_INTERNAL="unknown-host.example.com"",
2461
- "export HOST_CANONICAL="unknown-host.example.com"",
2462
- "export ROOT_URL_INTERNAL="https://unknown-host.example.com"",
2463
- "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\\"]"",
2464
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
2465
- "cd www",
2466
- "yarn deploy",
2467
- "echo 'Uploading SBOM to Dependency Track'",
2468
- "/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/www" "https://unknown-host.example.com" "__sbom.json" vex.json || true",
2469
- ],
2470
- "stage": "deploy review",
2471
- "variables": {
2472
- "KUBERNETES_CPU_REQUEST": "0.22",
2473
- "KUBERNETES_MEMORY_LIMIT": "400Mi",
2474
- "KUBERNETES_MEMORY_REQUEST": "200Mi",
2475
- },
2476
- },
2477
- "www 🛡 audit": {
2478
- "allow_failure": true,
2479
- "image": "path/to/docker/jobs-default:the-version",
2480
- "interruptible": true,
2481
- "needs": [],
2482
- "retry": {
2483
- "max": 2,
2484
- "when": [
2485
- "runner_system_failure",
2486
- "stuck_or_timeout_failure",
2487
- ],
2488
- },
2489
- "script": [
2490
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
2491
- "export APP_PATH="www"",
2492
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
2493
- "cd www",
2494
- "yarn npm audit --environment production",
2495
- ],
2496
- "stage": "test",
2497
- "variables": {
2498
- "KUBERNETES_CPU_REQUEST": "0.45",
2499
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
2500
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
2501
- },
2502
- },
2503
- "www 🧪 test": {
2504
- "cache": [
2505
- {
2506
- "key": "www-yarn",
2507
- "paths": [
2508
- "www/.yarn",
2509
- ],
2510
- "policy": "pull-push",
2511
- },
2512
- {
2513
- "key": "www-node-modules",
2514
- "paths": [
2515
- "www/node_modules",
2516
- ],
2517
- "policy": "pull-push",
2518
- },
2519
- ],
2520
- "image": "path/to/docker/jobs-testing-chrome:the-version",
2521
- "interruptible": true,
2522
- "needs": [],
2523
- "retry": {
2524
- "max": 2,
2525
- "when": [
2526
- "runner_system_failure",
2527
- "stuck_or_timeout_failure",
2528
- ],
2529
- },
2530
- "script": [
2531
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
2532
- "export APP_PATH="www"",
2533
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
2534
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
2535
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
2536
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
2537
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
2538
- "cd www",
2539
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
2540
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
2541
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
2542
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
2543
- "echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"",
2544
- "yarn install --immutable",
2545
- "echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"",
2546
- "yarn test",
2547
- ],
2548
- "stage": "test",
2549
- "variables": {
2550
- "KUBERNETES_CPU_REQUEST": "0.45",
2551
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
2552
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
2553
- },
2554
- },
2555
- "www 🧾 sbom | review ": {
2556
- "allow_failure": true,
2557
- "artifacts": {
2558
- "paths": [
2559
- "__sbom.json",
2560
- ],
2561
- },
2562
- "image": "aquasec/trivy:0.38.3",
2563
- "interruptible": true,
2564
- "needs": [],
2565
- "retry": {
2566
- "max": 2,
2567
- "when": [
2568
- "runner_system_failure",
2569
- "stuck_or_timeout_failure",
2570
- ],
2571
- },
2572
- "script": [
2573
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
2574
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
2575
- "trivy fs --quiet --format cyclonedx --output "__sbom.json" www",
2576
- ],
2577
- "stage": "build",
2578
- "variables": {},
2579
- },
2580
- },
2581
- "stages": [
2582
- "setup",
2583
- "setup dev",
2584
- "setup review",
2585
- "setup stage",
2586
- "setup prod",
2587
- "test",
2588
- "test dev",
2589
- "test review",
2590
- "test stage",
2591
- "test prod",
2592
- "build",
2593
- "build dev",
2594
- "build review",
2595
- "build stage",
2596
- "build prod",
2597
- "deploy",
2598
- "deploy dev",
2599
- "deploy review",
2600
- "deploy stage",
2601
- "deploy prod",
2602
- "verify",
2603
- "verify dev",
2604
- "verify review",
2605
- "verify stage",
2606
- "verify prod",
2607
- "rollback",
2608
- "rollback dev",
2609
- "rollback review",
2610
- "rollback stage",
2611
- "rollback prod",
2612
- "stop",
2613
- "stop dev",
2614
- "stop review",
2615
- "stop stage",
2616
- "stop prod",
2617
- ],
2618
- "variables": {
2619
- "ARTIFACT_COMPRESSION_LEVEL": "fast",
2620
- "CACHE_COMPRESSION_LEVEL": "fast",
2621
- "FF_USE_FASTZIP": "true",
2622
- "GIT_DEPTH": "1",
2623
- "TRANSFER_METER_FREQUENCY": "5s",
2624
- },
2625
- "workflow": {
2626
- "rules": [
2627
- {
2628
- "if": "$CI_COMMIT_TAG",
2629
- },
2630
- {
2631
- "if": "$CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/",
2632
- "when": "never",
2633
- },
2634
- {
2635
- "if": "$CI_PIPELINE_SOURCE == "schedule"",
2636
- "when": "never",
2637
- },
2638
- {
2639
- "if": "$CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/",
2640
- },
2641
- {
2642
- "if": "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH",
2643
- },
2644
- {
2645
- "if": "$CI_MERGE_REQUEST_ID",
2646
- },
2647
- ],
2648
- },
2649
- },
2650
- "taggedRelease": {
2651
- "image": "path/to/docker/jobs-default:the-version",
2652
- "jobs": {
2653
- "api 🔨 app | prod ": {
2654
- "artifacts": {
2655
- "expire_in": "1 day",
2656
- "paths": [
2657
- "api/__build_info.json",
2658
- "api/.next",
2659
- "api/dist",
2660
- ],
2661
- "reports": {
2662
- "junit": undefined,
2663
- },
2664
- "when": "always",
2665
- },
2666
- "cache": [
2667
- {
2668
- "key": "api-yarn",
2669
- "paths": [
2670
- "api/.yarn",
2671
- ],
2672
- "policy": "pull-push",
2673
- },
2674
- {
2675
- "key": "api-node-modules",
2676
- "paths": [
2677
- "api/node_modules",
2678
- ],
2679
- "policy": "pull-push",
2680
- },
2681
- {
2682
- "key": "api-next-cache",
2683
- "paths": [
2684
- "api/.next/cache",
2685
- ],
2686
- "policy": "pull-push",
2687
- },
2688
- ],
2689
- "image": "path/to/docker/jobs-default:the-version",
2690
- "interruptible": true,
2691
- "needs": [],
2692
- "retry": {
2693
- "max": 2,
2694
- "when": [
2695
- "runner_system_failure",
2696
- "stuck_or_timeout_failure",
2697
- ],
2698
- },
2699
- "script": [
2700
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
2701
- "export ENV_SHORT="prod"",
2702
- "export APP_DIR="api"",
2703
- "export ENV_TYPE="prod"",
2704
- "export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"",
2705
- "export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"",
2706
- "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")"",
2707
- "export HOST="unknown-host.example.com"",
2708
- "export ROOT_URL="https://unknown-host.example.com"",
2709
- "export HOST_INTERNAL="unknown-host.example.com"",
2710
- "export HOST_CANONICAL="unknown-host.example.com"",
2711
- "export ROOT_URL_INTERNAL="https://unknown-host.example.com"",
2712
- "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\\"]"",
2713
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
2714
- "echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > api/__build_info.json",
2715
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
2716
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
2717
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
2718
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
2719
- "cd api",
2720
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
2721
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
2722
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
2723
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
2724
- "echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"",
2725
- "yarn install --immutable",
2726
- "echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"",
2727
- "yarn build",
2728
- ],
2729
- "stage": "build",
2730
- "variables": {
2731
- "KUBERNETES_CPU_REQUEST": "0.45",
2732
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
2733
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
2734
- },
2735
- },
2736
- "api 🔨 app | stage ": {
2737
- "artifacts": {
2738
- "expire_in": "1 day",
2739
- "paths": [
2740
- "api/__build_info.json",
2741
- "api/.next",
2742
- "api/dist",
2743
- ],
2744
- "reports": {
2745
- "junit": undefined,
2746
- },
2747
- "when": "always",
2748
- },
2749
- "cache": [
2750
- {
2751
- "key": "api-yarn",
2752
- "paths": [
2753
- "api/.yarn",
2754
- ],
2755
- "policy": "pull-push",
2756
- },
2757
- {
2758
- "key": "api-node-modules",
2759
- "paths": [
2760
- "api/node_modules",
2761
- ],
2762
- "policy": "pull-push",
2763
- },
2764
- {
2765
- "key": "api-next-cache",
2766
- "paths": [
2767
- "api/.next/cache",
2768
- ],
2769
- "policy": "pull-push",
2770
- },
2771
- ],
2772
- "image": "path/to/docker/jobs-default:the-version",
2773
- "interruptible": true,
2774
- "needs": [],
2775
- "retry": {
2776
- "max": 2,
2777
- "when": [
2778
- "runner_system_failure",
2779
- "stuck_or_timeout_failure",
2780
- ],
2781
- },
2782
- "script": [
2783
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
2784
- "export ENV_SHORT="stage"",
2785
- "export APP_DIR="api"",
2786
- "export ENV_TYPE="stage"",
2787
- "export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"",
2788
- "export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"",
2789
- "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")"",
2790
- "export HOST="unknown-host.example.com"",
2791
- "export ROOT_URL="https://unknown-host.example.com"",
2792
- "export HOST_INTERNAL="unknown-host.example.com"",
2793
- "export HOST_CANONICAL="unknown-host.example.com"",
2794
- "export ROOT_URL_INTERNAL="https://unknown-host.example.com"",
2795
- "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\\"]"",
2796
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
2797
- "echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > api/__build_info.json",
2798
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
2799
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
2800
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
2801
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
2802
- "cd api",
2803
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
2804
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
2805
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
2806
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
2807
- "echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"",
2808
- "yarn install --immutable",
2809
- "echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"",
2810
- "yarn build",
2811
- ],
2812
- "stage": "build",
2813
- "variables": {
2814
- "KUBERNETES_CPU_REQUEST": "0.45",
2815
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
2816
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
2817
- },
2818
- },
2819
- "api 🚀 Deploy | prod ": {
2820
- "allow_failure": true,
2821
- "cache": [],
2822
- "image": "path/to/docker/jobs-default:the-version",
2823
- "interruptible": true,
2824
- "needs": [
2825
- {
2826
- "artifacts": true,
2827
- "job": "api 🔨 app | prod ",
2828
- },
2829
- {
2830
- "artifacts": true,
2831
- "job": "api 🧾 sbom | prod ",
2832
- },
2833
- ],
2834
- "retry": {
2835
- "max": 2,
2836
- "when": [
2837
- "runner_system_failure",
2838
- "stuck_or_timeout_failure",
2839
- ],
2840
- },
2841
- "rules": [
2842
- {
2843
- "when": "manual",
2844
- },
2845
- ],
2846
- "script": [
2847
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
2848
- "export ENV_SHORT="prod"",
2849
- "export APP_DIR="api"",
2850
- "export ENV_TYPE="prod"",
2851
- "export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"",
2852
- "export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"",
2853
- "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")"",
2854
- "export HOST="unknown-host.example.com"",
2855
- "export ROOT_URL="https://unknown-host.example.com"",
2856
- "export HOST_INTERNAL="unknown-host.example.com"",
2857
- "export HOST_CANONICAL="unknown-host.example.com"",
2858
- "export ROOT_URL_INTERNAL="https://unknown-host.example.com"",
2859
- "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\\"]"",
2860
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
2861
- "cd api",
2862
- "yarn deploy",
2863
- "echo 'Uploading SBOM to Dependency Track'",
2864
- "/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/api" "https://unknown-host.example.com" "__sbom.json" vex.json || true",
2865
- ],
2866
- "stage": "deploy prod",
2867
- "variables": {
2868
- "KUBERNETES_CPU_REQUEST": "0.22",
2869
- "KUBERNETES_MEMORY_LIMIT": "400Mi",
2870
- "KUBERNETES_MEMORY_REQUEST": "200Mi",
2871
- },
2872
- },
2873
- "api 🚀 Deploy | stage ": {
2874
- "allow_failure": false,
2875
- "cache": [],
2876
- "image": "path/to/docker/jobs-default:the-version",
2877
- "interruptible": true,
2878
- "needs": [
2879
- {
2880
- "artifacts": true,
2881
- "job": "api 🔨 app | stage ",
2882
- },
2883
- {
2884
- "artifacts": true,
2885
- "job": "api 🧾 sbom | stage ",
2886
- },
2887
- ],
2888
- "retry": {
2889
- "max": 2,
2890
- "when": [
2891
- "runner_system_failure",
2892
- "stuck_or_timeout_failure",
2893
- ],
2894
- },
2895
- "rules": [
2896
- {
2897
- "when": "on_success",
2898
- },
2899
- ],
2900
- "script": [
2901
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
2902
- "export ENV_SHORT="stage"",
2903
- "export APP_DIR="api"",
2904
- "export ENV_TYPE="stage"",
2905
- "export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"",
2906
- "export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"",
2907
- "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")"",
2908
- "export HOST="unknown-host.example.com"",
2909
- "export ROOT_URL="https://unknown-host.example.com"",
2910
- "export HOST_INTERNAL="unknown-host.example.com"",
2911
- "export HOST_CANONICAL="unknown-host.example.com"",
2912
- "export ROOT_URL_INTERNAL="https://unknown-host.example.com"",
2913
- "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\\"]"",
2914
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
2915
- "cd api",
2916
- "yarn deploy",
2917
- "echo 'Uploading SBOM to Dependency Track'",
2918
- "/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/api" "https://unknown-host.example.com" "__sbom.json" vex.json || true",
2919
- ],
2920
- "stage": "deploy stage",
2921
- "variables": {
2922
- "KUBERNETES_CPU_REQUEST": "0.22",
2923
- "KUBERNETES_MEMORY_LIMIT": "400Mi",
2924
- "KUBERNETES_MEMORY_REQUEST": "200Mi",
2925
- },
2926
- },
2927
- "api 🧾 sbom | prod ": {
2928
- "allow_failure": true,
2929
- "artifacts": {
2930
- "paths": [
2931
- "__sbom.json",
2932
- ],
2933
- },
2934
- "image": "aquasec/trivy:0.38.3",
2935
- "interruptible": true,
2936
- "needs": [],
2937
- "retry": {
2938
- "max": 2,
2939
- "when": [
2940
- "runner_system_failure",
2941
- "stuck_or_timeout_failure",
2942
- ],
2943
- },
2944
- "script": [
2945
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
2946
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
2947
- "trivy fs --quiet --format cyclonedx --output "__sbom.json" api",
2948
- ],
2949
- "stage": "build",
2950
- "variables": {},
2951
- },
2952
- "api 🧾 sbom | stage ": {
2953
- "allow_failure": true,
2954
- "artifacts": {
2955
- "paths": [
2956
- "__sbom.json",
2957
- ],
2958
- },
2959
- "image": "aquasec/trivy:0.38.3",
2960
- "interruptible": true,
2961
- "needs": [],
2962
- "retry": {
2963
- "max": 2,
2964
- "when": [
2965
- "runner_system_failure",
2966
- "stuck_or_timeout_failure",
2967
- ],
2968
- },
2969
- "script": [
2970
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
2971
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
2972
- "trivy fs --quiet --format cyclonedx --output "__sbom.json" api",
2973
- ],
2974
- "stage": "build",
2975
- "variables": {},
2976
- },
2977
- "www 🔨 app | prod ": {
2978
- "artifacts": {
2979
- "expire_in": "1 day",
2980
- "paths": [
2981
- "www/__build_info.json",
2982
- "www/.next",
2983
- "www/dist",
2984
- ],
2985
- "reports": {
2986
- "junit": undefined,
2987
- },
2988
- "when": "always",
2989
- },
2990
- "cache": [
2991
- {
2992
- "key": "www-yarn",
2993
- "paths": [
2994
- "www/.yarn",
2995
- ],
2996
- "policy": "pull-push",
2997
- },
2998
- {
2999
- "key": "www-node-modules",
3000
- "paths": [
3001
- "www/node_modules",
3002
- ],
3003
- "policy": "pull-push",
3004
- },
3005
- {
3006
- "key": "www-next-cache",
3007
- "paths": [
3008
- "www/.next/cache",
3009
- ],
3010
- "policy": "pull-push",
3011
- },
3012
- ],
3013
- "image": "path/to/docker/jobs-default:the-version",
3014
- "interruptible": true,
3015
- "needs": [],
3016
- "retry": {
3017
- "max": 2,
3018
- "when": [
3019
- "runner_system_failure",
3020
- "stuck_or_timeout_failure",
3021
- ],
3022
- },
3023
- "script": [
3024
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
3025
- "export ENV_SHORT="prod"",
3026
- "export APP_DIR="www"",
3027
- "export ENV_TYPE="prod"",
3028
- "export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"",
3029
- "export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"",
3030
- "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")"",
3031
- "export HOST="unknown-host.example.com"",
3032
- "export ROOT_URL="https://unknown-host.example.com"",
3033
- "export HOST_INTERNAL="unknown-host.example.com"",
3034
- "export HOST_CANONICAL="unknown-host.example.com"",
3035
- "export ROOT_URL_INTERNAL="https://unknown-host.example.com"",
3036
- "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\\"]"",
3037
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
3038
- "echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > www/__build_info.json",
3039
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
3040
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
3041
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
3042
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
3043
- "cd www",
3044
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
3045
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
3046
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
3047
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
3048
- "echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"",
3049
- "yarn install --immutable",
3050
- "echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"",
3051
- "yarn build",
3052
- ],
3053
- "stage": "build",
3054
- "variables": {
3055
- "KUBERNETES_CPU_REQUEST": "0.45",
3056
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
3057
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
3058
- },
3059
- },
3060
- "www 🔨 app | stage ": {
3061
- "artifacts": {
3062
- "expire_in": "1 day",
3063
- "paths": [
3064
- "www/__build_info.json",
3065
- "www/.next",
3066
- "www/dist",
3067
- ],
3068
- "reports": {
3069
- "junit": undefined,
3070
- },
3071
- "when": "always",
3072
- },
3073
- "cache": [
3074
- {
3075
- "key": "www-yarn",
3076
- "paths": [
3077
- "www/.yarn",
3078
- ],
3079
- "policy": "pull-push",
3080
- },
3081
- {
3082
- "key": "www-node-modules",
3083
- "paths": [
3084
- "www/node_modules",
3085
- ],
3086
- "policy": "pull-push",
3087
- },
3088
- {
3089
- "key": "www-next-cache",
3090
- "paths": [
3091
- "www/.next/cache",
3092
- ],
3093
- "policy": "pull-push",
3094
- },
3095
- ],
3096
- "image": "path/to/docker/jobs-default:the-version",
3097
- "interruptible": true,
3098
- "needs": [],
3099
- "retry": {
3100
- "max": 2,
3101
- "when": [
3102
- "runner_system_failure",
3103
- "stuck_or_timeout_failure",
3104
- ],
3105
- },
3106
- "script": [
3107
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
3108
- "export ENV_SHORT="stage"",
3109
- "export APP_DIR="www"",
3110
- "export ENV_TYPE="stage"",
3111
- "export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"",
3112
- "export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"",
3113
- "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")"",
3114
- "export HOST="unknown-host.example.com"",
3115
- "export ROOT_URL="https://unknown-host.example.com"",
3116
- "export HOST_INTERNAL="unknown-host.example.com"",
3117
- "export HOST_CANONICAL="unknown-host.example.com"",
3118
- "export ROOT_URL_INTERNAL="https://unknown-host.example.com"",
3119
- "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\\"]"",
3120
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
3121
- "echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > www/__build_info.json",
3122
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
3123
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
3124
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
3125
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
3126
- "cd www",
3127
- "echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
3128
- "if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
3129
- "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
3130
- "echo -e "\\e[0Ksection_end:$(date +%s):nodeinstall\\r\\e[0K"",
3131
- "echo -e "\\e[0Ksection_start:$(date +%s):yarninstall[collapsed=true]\\r\\e[0KYarn install"",
3132
- "yarn install --immutable",
3133
- "echo -e "\\e[0Ksection_end:$(date +%s):yarninstall\\r\\e[0K"",
3134
- "yarn build",
3135
- ],
3136
- "stage": "build",
3137
- "variables": {
3138
- "KUBERNETES_CPU_REQUEST": "0.45",
3139
- "KUBERNETES_MEMORY_LIMIT": "4Gi",
3140
- "KUBERNETES_MEMORY_REQUEST": "1Gi",
3141
- },
3142
- },
3143
- "www 🚀 Deploy | prod ": {
3144
- "allow_failure": true,
3145
- "cache": [],
3146
- "image": "path/to/docker/jobs-default:the-version",
3147
- "interruptible": true,
3148
- "needs": [
3149
- {
3150
- "artifacts": false,
3151
- "job": "api 🚀 Deploy | prod ",
3152
- },
3153
- {
3154
- "artifacts": true,
3155
- "job": "www 🔨 app | prod ",
3156
- },
3157
- {
3158
- "artifacts": true,
3159
- "job": "www 🧾 sbom | prod ",
3160
- },
3161
- ],
3162
- "retry": {
3163
- "max": 2,
3164
- "when": [
3165
- "runner_system_failure",
3166
- "stuck_or_timeout_failure",
3167
- ],
3168
- },
3169
- "rules": [
3170
- {
3171
- "when": "manual",
3172
- },
3173
- ],
3174
- "script": [
3175
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
3176
- "export ENV_SHORT="prod"",
3177
- "export APP_DIR="www"",
3178
- "export ENV_TYPE="prod"",
3179
- "export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"",
3180
- "export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"",
3181
- "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")"",
3182
- "export HOST="unknown-host.example.com"",
3183
- "export ROOT_URL="https://unknown-host.example.com"",
3184
- "export HOST_INTERNAL="unknown-host.example.com"",
3185
- "export HOST_CANONICAL="unknown-host.example.com"",
3186
- "export ROOT_URL_INTERNAL="https://unknown-host.example.com"",
3187
- "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\\"]"",
3188
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
3189
- "cd www",
3190
- "yarn deploy",
3191
- "echo 'Uploading SBOM to Dependency Track'",
3192
- "/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/www" "https://unknown-host.example.com" "__sbom.json" vex.json || true",
3193
- ],
3194
- "stage": "deploy prod",
3195
- "variables": {
3196
- "KUBERNETES_CPU_REQUEST": "0.22",
3197
- "KUBERNETES_MEMORY_LIMIT": "400Mi",
3198
- "KUBERNETES_MEMORY_REQUEST": "200Mi",
3199
- },
3200
- },
3201
- "www 🚀 Deploy | stage ": {
3202
- "allow_failure": false,
3203
- "cache": [],
3204
- "image": "path/to/docker/jobs-default:the-version",
3205
- "interruptible": true,
3206
- "needs": [
3207
- {
3208
- "artifacts": false,
3209
- "job": "api 🚀 Deploy | stage ",
3210
- },
3211
- {
3212
- "artifacts": true,
3213
- "job": "www 🔨 app | stage ",
3214
- },
3215
- {
3216
- "artifacts": true,
3217
- "job": "www 🧾 sbom | stage ",
3218
- },
3219
- ],
3220
- "retry": {
3221
- "max": 2,
3222
- "when": [
3223
- "runner_system_failure",
3224
- "stuck_or_timeout_failure",
3225
- ],
3226
- },
3227
- "rules": [
3228
- {
3229
- "when": "on_success",
3230
- },
3231
- ],
3232
- "script": [
3233
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
3234
- "export ENV_SHORT="stage"",
3235
- "export APP_DIR="www"",
3236
- "export ENV_TYPE="stage"",
3237
- "export BUILD_INFO_BUILD_ID="$(git describe --tags 2>/dev/null || git rev-parse HEAD)"",
3238
- "export BUILD_INFO_BUILD_TIME="$CI_JOB_STARTED_AT"",
3239
- "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")"",
3240
- "export HOST="unknown-host.example.com"",
3241
- "export ROOT_URL="https://unknown-host.example.com"",
3242
- "export HOST_INTERNAL="unknown-host.example.com"",
3243
- "export HOST_CANONICAL="unknown-host.example.com"",
3244
- "export ROOT_URL_INTERNAL="https://unknown-host.example.com"",
3245
- "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\\"]"",
3246
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
3247
- "cd www",
3248
- "yarn deploy",
3249
- "echo 'Uploading SBOM to Dependency Track'",
3250
- "/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/www" "https://unknown-host.example.com" "__sbom.json" vex.json || true",
3251
- ],
3252
- "stage": "deploy stage",
3253
- "variables": {
3254
- "KUBERNETES_CPU_REQUEST": "0.22",
3255
- "KUBERNETES_MEMORY_LIMIT": "400Mi",
3256
- "KUBERNETES_MEMORY_REQUEST": "200Mi",
3257
- },
3258
- },
3259
- "www 🧾 sbom | prod ": {
3260
- "allow_failure": true,
3261
- "artifacts": {
3262
- "paths": [
3263
- "__sbom.json",
3264
- ],
3265
- },
3266
- "image": "aquasec/trivy:0.38.3",
3267
- "interruptible": true,
3268
- "needs": [],
3269
- "retry": {
3270
- "max": 2,
3271
- "when": [
3272
- "runner_system_failure",
3273
- "stuck_or_timeout_failure",
3274
- ],
3275
- },
3276
- "script": [
3277
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
3278
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
3279
- "trivy fs --quiet --format cyclonedx --output "__sbom.json" www",
3280
- ],
3281
- "stage": "build",
3282
- "variables": {},
3283
- },
3284
- "www 🧾 sbom | stage ": {
3285
- "allow_failure": true,
3286
- "artifacts": {
3287
- "paths": [
3288
- "__sbom.json",
3289
- ],
3290
- },
3291
- "image": "aquasec/trivy:0.38.3",
3292
- "interruptible": true,
3293
- "needs": [],
3294
- "retry": {
3295
- "max": 2,
3296
- "when": [
3297
- "runner_system_failure",
3298
- "stuck_or_timeout_failure",
3299
- ],
3300
- },
3301
- "script": [
3302
- "echo -e "\\e[0Ksection_start:$(date +%s):injectvars[collapsed=true]\\r\\e[0KInjecting variables"",
3303
- "echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
3304
- "trivy fs --quiet --format cyclonedx --output "__sbom.json" www",
3305
- ],
3306
- "stage": "build",
3307
- "variables": {},
3308
- },
3309
- },
3310
- "stages": [
3311
- "setup",
3312
- "setup dev",
3313
- "setup review",
3314
- "setup stage",
3315
- "setup prod",
3316
- "test",
3317
- "test dev",
3318
- "test review",
3319
- "test stage",
3320
- "test prod",
3321
- "build",
3322
- "build dev",
3323
- "build review",
3324
- "build stage",
3325
- "build prod",
3326
- "deploy",
3327
- "deploy dev",
3328
- "deploy review",
3329
- "deploy stage",
3330
- "deploy prod",
3331
- "verify",
3332
- "verify dev",
3333
- "verify review",
3334
- "verify stage",
3335
- "verify prod",
3336
- "rollback",
3337
- "rollback dev",
3338
- "rollback review",
3339
- "rollback stage",
3340
- "rollback prod",
3341
- "stop",
3342
- "stop dev",
3343
- "stop review",
3344
- "stop stage",
3345
- "stop prod",
3346
- ],
3347
- "variables": {
3348
- "ARTIFACT_COMPRESSION_LEVEL": "fast",
3349
- "CACHE_COMPRESSION_LEVEL": "fast",
3350
- "FF_USE_FASTZIP": "true",
3351
- "GIT_DEPTH": "1",
3352
- "TRANSFER_METER_FREQUENCY": "5s",
3353
- },
3354
- "workflow": {
3355
- "rules": [
3356
- {
3357
- "if": "$CI_COMMIT_TAG",
3358
- },
3359
- {
3360
- "if": "$CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/",
3361
- "when": "never",
3362
- },
3363
- {
3364
- "if": "$CI_PIPELINE_SOURCE == "schedule"",
3365
- "when": "never",
3366
- },
3367
- {
3368
- "if": "$CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/",
3369
- },
3370
- {
3371
- "if": "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH",
3372
- },
3373
- {
3374
- "if": "$CI_MERGE_REQUEST_ID",
3375
- },
3376
- ],
3377
- },
3378
- },
3379
- }
3380
- `;