@catladder/pipeline 1.97.2 → 1.98.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/types.d.ts +10 -0
- package/dist/bundles/catladder-gitlab/index.js +1 -1
- package/dist/constants.js +1 -1
- package/dist/pipeline/createJobsForComponent.js +3 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/verify/reporting.d.ts +3 -0
- package/dist/verify/reporting.js +48 -0
- package/examples/__snapshots__/cloud-run-memory-limit.ts.snap +196 -0
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.ts.snap +196 -0
- package/examples/__snapshots__/cloud-run-non-public.ts.snap +196 -0
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.ts.snap +392 -0
- package/examples/__snapshots__/cloud-run-with-sql.ts.snap +392 -0
- package/examples/__snapshots__/custom-build-job-with-tests.ts.snap +196 -0
- package/examples/__snapshots__/custom-build-job.ts.snap +196 -0
- package/examples/__snapshots__/custom-deploy.ts.snap +196 -0
- package/examples/__snapshots__/custom-sbom-java.ts.snap +1386 -0
- package/examples/__snapshots__/kubernetes-application-customization.ts.snap +196 -0
- package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.ts.snap +196 -0
- package/examples/__snapshots__/kubernetes-with-cloud-sql.ts.snap +196 -0
- package/examples/__snapshots__/kubernetes-with-jobs.ts.snap +392 -0
- package/examples/__snapshots__/rails-k8s-with-worker.ts.snap +196 -0
- package/examples/__snapshots__/wait-for-other-deploy.ts.snap +392 -0
- package/examples/custom-sbom-java.ts +34 -0
- package/package.json +1 -1
- package/src/build/types.ts +13 -0
- package/src/pipeline/createJobsForComponent.ts +3 -1
- package/src/verify/reporting.ts +69 -0
|
@@ -240,6 +240,55 @@ exports[`matches snapshot 1`] = `
|
|
|
240
240
|
"KUBERNETES_MEMORY_REQUEST": "2Gi",
|
|
241
241
|
},
|
|
242
242
|
},
|
|
243
|
+
"api 🧾 sbom upload | dev ": {
|
|
244
|
+
"allow_failure": true,
|
|
245
|
+
"cache": undefined,
|
|
246
|
+
"environment": undefined,
|
|
247
|
+
"image": "git.panter.ch:5001/open-source/dependency-track-uploader:dtrackuploader-v0.2.1",
|
|
248
|
+
"interruptible": true,
|
|
249
|
+
"needs": [
|
|
250
|
+
"api 🧾 sbom | dev ",
|
|
251
|
+
],
|
|
252
|
+
"retry": {
|
|
253
|
+
"max": 2,
|
|
254
|
+
"when": [
|
|
255
|
+
"runner_system_failure",
|
|
256
|
+
"stuck_or_timeout_failure",
|
|
257
|
+
],
|
|
258
|
+
},
|
|
259
|
+
"script": [
|
|
260
|
+
"/dtrackuploader https://dep.panter.dev/ "$DT_KEY" upload "pan-test-app/api" "dev" "__sbom.json" vex.json",
|
|
261
|
+
],
|
|
262
|
+
"stage": "verify",
|
|
263
|
+
"variables": {},
|
|
264
|
+
},
|
|
265
|
+
"api 🧾 sbom | dev ": {
|
|
266
|
+
"allow_failure": true,
|
|
267
|
+
"artifacts": {
|
|
268
|
+
"paths": [
|
|
269
|
+
"__sbom.json",
|
|
270
|
+
],
|
|
271
|
+
},
|
|
272
|
+
"cache": undefined,
|
|
273
|
+
"environment": undefined,
|
|
274
|
+
"image": "aquasec/trivy:0.38.3",
|
|
275
|
+
"interruptible": true,
|
|
276
|
+
"needs": [
|
|
277
|
+
"api 🚀 Deploy | dev ",
|
|
278
|
+
],
|
|
279
|
+
"retry": {
|
|
280
|
+
"max": 2,
|
|
281
|
+
"when": [
|
|
282
|
+
"runner_system_failure",
|
|
283
|
+
"stuck_or_timeout_failure",
|
|
284
|
+
],
|
|
285
|
+
},
|
|
286
|
+
"script": [
|
|
287
|
+
"trivy fs --quiet --format cyclonedx --output "__sbom.json" api",
|
|
288
|
+
],
|
|
289
|
+
"stage": "verify",
|
|
290
|
+
"variables": {},
|
|
291
|
+
},
|
|
243
292
|
"www 👮 lint": {
|
|
244
293
|
"cache": [
|
|
245
294
|
{
|
|
@@ -479,6 +528,55 @@ exports[`matches snapshot 1`] = `
|
|
|
479
528
|
"KUBERNETES_MEMORY_REQUEST": "2Gi",
|
|
480
529
|
},
|
|
481
530
|
},
|
|
531
|
+
"www 🧾 sbom upload | dev ": {
|
|
532
|
+
"allow_failure": true,
|
|
533
|
+
"cache": undefined,
|
|
534
|
+
"environment": undefined,
|
|
535
|
+
"image": "git.panter.ch:5001/open-source/dependency-track-uploader:dtrackuploader-v0.2.1",
|
|
536
|
+
"interruptible": true,
|
|
537
|
+
"needs": [
|
|
538
|
+
"www 🧾 sbom | dev ",
|
|
539
|
+
],
|
|
540
|
+
"retry": {
|
|
541
|
+
"max": 2,
|
|
542
|
+
"when": [
|
|
543
|
+
"runner_system_failure",
|
|
544
|
+
"stuck_or_timeout_failure",
|
|
545
|
+
],
|
|
546
|
+
},
|
|
547
|
+
"script": [
|
|
548
|
+
"/dtrackuploader https://dep.panter.dev/ "$DT_KEY" upload "pan-test-app/www" "dev" "__sbom.json" vex.json",
|
|
549
|
+
],
|
|
550
|
+
"stage": "verify",
|
|
551
|
+
"variables": {},
|
|
552
|
+
},
|
|
553
|
+
"www 🧾 sbom | dev ": {
|
|
554
|
+
"allow_failure": true,
|
|
555
|
+
"artifacts": {
|
|
556
|
+
"paths": [
|
|
557
|
+
"__sbom.json",
|
|
558
|
+
],
|
|
559
|
+
},
|
|
560
|
+
"cache": undefined,
|
|
561
|
+
"environment": undefined,
|
|
562
|
+
"image": "aquasec/trivy:0.38.3",
|
|
563
|
+
"interruptible": true,
|
|
564
|
+
"needs": [
|
|
565
|
+
"www 🚀 Deploy | dev ",
|
|
566
|
+
],
|
|
567
|
+
"retry": {
|
|
568
|
+
"max": 2,
|
|
569
|
+
"when": [
|
|
570
|
+
"runner_system_failure",
|
|
571
|
+
"stuck_or_timeout_failure",
|
|
572
|
+
],
|
|
573
|
+
},
|
|
574
|
+
"script": [
|
|
575
|
+
"trivy fs --quiet --format cyclonedx --output "__sbom.json" www",
|
|
576
|
+
],
|
|
577
|
+
"stage": "verify",
|
|
578
|
+
"variables": {},
|
|
579
|
+
},
|
|
482
580
|
},
|
|
483
581
|
"stages": [
|
|
484
582
|
"setup",
|
|
@@ -786,6 +884,55 @@ exports[`matches snapshot 1`] = `
|
|
|
786
884
|
"KUBERNETES_MEMORY_REQUEST": "2Gi",
|
|
787
885
|
},
|
|
788
886
|
},
|
|
887
|
+
"api 🧾 sbom upload | review ": {
|
|
888
|
+
"allow_failure": true,
|
|
889
|
+
"cache": undefined,
|
|
890
|
+
"environment": undefined,
|
|
891
|
+
"image": "git.panter.ch:5001/open-source/dependency-track-uploader:dtrackuploader-v0.2.1",
|
|
892
|
+
"interruptible": true,
|
|
893
|
+
"needs": [
|
|
894
|
+
"api 🧾 sbom | review ",
|
|
895
|
+
],
|
|
896
|
+
"retry": {
|
|
897
|
+
"max": 2,
|
|
898
|
+
"when": [
|
|
899
|
+
"runner_system_failure",
|
|
900
|
+
"stuck_or_timeout_failure",
|
|
901
|
+
],
|
|
902
|
+
},
|
|
903
|
+
"script": [
|
|
904
|
+
"/dtrackuploader https://dep.panter.dev/ "$DT_KEY" upload "pan-test-app/api" "review" "__sbom.json" vex.json",
|
|
905
|
+
],
|
|
906
|
+
"stage": "verify",
|
|
907
|
+
"variables": {},
|
|
908
|
+
},
|
|
909
|
+
"api 🧾 sbom | review ": {
|
|
910
|
+
"allow_failure": true,
|
|
911
|
+
"artifacts": {
|
|
912
|
+
"paths": [
|
|
913
|
+
"__sbom.json",
|
|
914
|
+
],
|
|
915
|
+
},
|
|
916
|
+
"cache": undefined,
|
|
917
|
+
"environment": undefined,
|
|
918
|
+
"image": "aquasec/trivy:0.38.3",
|
|
919
|
+
"interruptible": true,
|
|
920
|
+
"needs": [
|
|
921
|
+
"api 🚀 Deploy | review ",
|
|
922
|
+
],
|
|
923
|
+
"retry": {
|
|
924
|
+
"max": 2,
|
|
925
|
+
"when": [
|
|
926
|
+
"runner_system_failure",
|
|
927
|
+
"stuck_or_timeout_failure",
|
|
928
|
+
],
|
|
929
|
+
},
|
|
930
|
+
"script": [
|
|
931
|
+
"trivy fs --quiet --format cyclonedx --output "__sbom.json" api",
|
|
932
|
+
],
|
|
933
|
+
"stage": "verify",
|
|
934
|
+
"variables": {},
|
|
935
|
+
},
|
|
789
936
|
"www 👮 lint": {
|
|
790
937
|
"cache": [
|
|
791
938
|
{
|
|
@@ -1025,6 +1172,55 @@ exports[`matches snapshot 1`] = `
|
|
|
1025
1172
|
"KUBERNETES_MEMORY_REQUEST": "2Gi",
|
|
1026
1173
|
},
|
|
1027
1174
|
},
|
|
1175
|
+
"www 🧾 sbom upload | review ": {
|
|
1176
|
+
"allow_failure": true,
|
|
1177
|
+
"cache": undefined,
|
|
1178
|
+
"environment": undefined,
|
|
1179
|
+
"image": "git.panter.ch:5001/open-source/dependency-track-uploader:dtrackuploader-v0.2.1",
|
|
1180
|
+
"interruptible": true,
|
|
1181
|
+
"needs": [
|
|
1182
|
+
"www 🧾 sbom | review ",
|
|
1183
|
+
],
|
|
1184
|
+
"retry": {
|
|
1185
|
+
"max": 2,
|
|
1186
|
+
"when": [
|
|
1187
|
+
"runner_system_failure",
|
|
1188
|
+
"stuck_or_timeout_failure",
|
|
1189
|
+
],
|
|
1190
|
+
},
|
|
1191
|
+
"script": [
|
|
1192
|
+
"/dtrackuploader https://dep.panter.dev/ "$DT_KEY" upload "pan-test-app/www" "review" "__sbom.json" vex.json",
|
|
1193
|
+
],
|
|
1194
|
+
"stage": "verify",
|
|
1195
|
+
"variables": {},
|
|
1196
|
+
},
|
|
1197
|
+
"www 🧾 sbom | review ": {
|
|
1198
|
+
"allow_failure": true,
|
|
1199
|
+
"artifacts": {
|
|
1200
|
+
"paths": [
|
|
1201
|
+
"__sbom.json",
|
|
1202
|
+
],
|
|
1203
|
+
},
|
|
1204
|
+
"cache": undefined,
|
|
1205
|
+
"environment": undefined,
|
|
1206
|
+
"image": "aquasec/trivy:0.38.3",
|
|
1207
|
+
"interruptible": true,
|
|
1208
|
+
"needs": [
|
|
1209
|
+
"www 🚀 Deploy | review ",
|
|
1210
|
+
],
|
|
1211
|
+
"retry": {
|
|
1212
|
+
"max": 2,
|
|
1213
|
+
"when": [
|
|
1214
|
+
"runner_system_failure",
|
|
1215
|
+
"stuck_or_timeout_failure",
|
|
1216
|
+
],
|
|
1217
|
+
},
|
|
1218
|
+
"script": [
|
|
1219
|
+
"trivy fs --quiet --format cyclonedx --output "__sbom.json" www",
|
|
1220
|
+
],
|
|
1221
|
+
"stage": "verify",
|
|
1222
|
+
"variables": {},
|
|
1223
|
+
},
|
|
1028
1224
|
},
|
|
1029
1225
|
"stages": [
|
|
1030
1226
|
"setup",
|
|
@@ -1321,6 +1517,104 @@ exports[`matches snapshot 1`] = `
|
|
|
1321
1517
|
"_ALL_ENV_VAR_KEYS": "["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL"]",
|
|
1322
1518
|
},
|
|
1323
1519
|
},
|
|
1520
|
+
"api 🧾 sbom upload | prod ": {
|
|
1521
|
+
"allow_failure": true,
|
|
1522
|
+
"cache": undefined,
|
|
1523
|
+
"environment": undefined,
|
|
1524
|
+
"image": "git.panter.ch:5001/open-source/dependency-track-uploader:dtrackuploader-v0.2.1",
|
|
1525
|
+
"interruptible": true,
|
|
1526
|
+
"needs": [
|
|
1527
|
+
"api 🧾 sbom | prod ",
|
|
1528
|
+
],
|
|
1529
|
+
"retry": {
|
|
1530
|
+
"max": 2,
|
|
1531
|
+
"when": [
|
|
1532
|
+
"runner_system_failure",
|
|
1533
|
+
"stuck_or_timeout_failure",
|
|
1534
|
+
],
|
|
1535
|
+
},
|
|
1536
|
+
"script": [
|
|
1537
|
+
"/dtrackuploader https://dep.panter.dev/ "$DT_KEY" upload "pan-test-app/api" "prod" "__sbom.json" vex.json",
|
|
1538
|
+
],
|
|
1539
|
+
"stage": "verify",
|
|
1540
|
+
"variables": {},
|
|
1541
|
+
},
|
|
1542
|
+
"api 🧾 sbom upload | stage ": {
|
|
1543
|
+
"allow_failure": true,
|
|
1544
|
+
"cache": undefined,
|
|
1545
|
+
"environment": undefined,
|
|
1546
|
+
"image": "git.panter.ch:5001/open-source/dependency-track-uploader:dtrackuploader-v0.2.1",
|
|
1547
|
+
"interruptible": true,
|
|
1548
|
+
"needs": [
|
|
1549
|
+
"api 🧾 sbom | stage ",
|
|
1550
|
+
],
|
|
1551
|
+
"retry": {
|
|
1552
|
+
"max": 2,
|
|
1553
|
+
"when": [
|
|
1554
|
+
"runner_system_failure",
|
|
1555
|
+
"stuck_or_timeout_failure",
|
|
1556
|
+
],
|
|
1557
|
+
},
|
|
1558
|
+
"script": [
|
|
1559
|
+
"/dtrackuploader https://dep.panter.dev/ "$DT_KEY" upload "pan-test-app/api" "stage" "__sbom.json" vex.json",
|
|
1560
|
+
],
|
|
1561
|
+
"stage": "verify",
|
|
1562
|
+
"variables": {},
|
|
1563
|
+
},
|
|
1564
|
+
"api 🧾 sbom | prod ": {
|
|
1565
|
+
"allow_failure": true,
|
|
1566
|
+
"artifacts": {
|
|
1567
|
+
"paths": [
|
|
1568
|
+
"__sbom.json",
|
|
1569
|
+
],
|
|
1570
|
+
},
|
|
1571
|
+
"cache": undefined,
|
|
1572
|
+
"environment": undefined,
|
|
1573
|
+
"image": "aquasec/trivy:0.38.3",
|
|
1574
|
+
"interruptible": true,
|
|
1575
|
+
"needs": [
|
|
1576
|
+
"api 🚀 Deploy | prod ",
|
|
1577
|
+
],
|
|
1578
|
+
"retry": {
|
|
1579
|
+
"max": 2,
|
|
1580
|
+
"when": [
|
|
1581
|
+
"runner_system_failure",
|
|
1582
|
+
"stuck_or_timeout_failure",
|
|
1583
|
+
],
|
|
1584
|
+
},
|
|
1585
|
+
"script": [
|
|
1586
|
+
"trivy fs --quiet --format cyclonedx --output "__sbom.json" api",
|
|
1587
|
+
],
|
|
1588
|
+
"stage": "verify",
|
|
1589
|
+
"variables": {},
|
|
1590
|
+
},
|
|
1591
|
+
"api 🧾 sbom | stage ": {
|
|
1592
|
+
"allow_failure": true,
|
|
1593
|
+
"artifacts": {
|
|
1594
|
+
"paths": [
|
|
1595
|
+
"__sbom.json",
|
|
1596
|
+
],
|
|
1597
|
+
},
|
|
1598
|
+
"cache": undefined,
|
|
1599
|
+
"environment": undefined,
|
|
1600
|
+
"image": "aquasec/trivy:0.38.3",
|
|
1601
|
+
"interruptible": true,
|
|
1602
|
+
"needs": [
|
|
1603
|
+
"api 🚀 Deploy | stage ",
|
|
1604
|
+
],
|
|
1605
|
+
"retry": {
|
|
1606
|
+
"max": 2,
|
|
1607
|
+
"when": [
|
|
1608
|
+
"runner_system_failure",
|
|
1609
|
+
"stuck_or_timeout_failure",
|
|
1610
|
+
],
|
|
1611
|
+
},
|
|
1612
|
+
"script": [
|
|
1613
|
+
"trivy fs --quiet --format cyclonedx --output "__sbom.json" api",
|
|
1614
|
+
],
|
|
1615
|
+
"stage": "verify",
|
|
1616
|
+
"variables": {},
|
|
1617
|
+
},
|
|
1324
1618
|
"www 🔨 app | prod ": {
|
|
1325
1619
|
"artifacts": {
|
|
1326
1620
|
"paths": [
|
|
@@ -1553,6 +1847,104 @@ exports[`matches snapshot 1`] = `
|
|
|
1553
1847
|
"_ALL_ENV_VAR_KEYS": "["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL"]",
|
|
1554
1848
|
},
|
|
1555
1849
|
},
|
|
1850
|
+
"www 🧾 sbom upload | prod ": {
|
|
1851
|
+
"allow_failure": true,
|
|
1852
|
+
"cache": undefined,
|
|
1853
|
+
"environment": undefined,
|
|
1854
|
+
"image": "git.panter.ch:5001/open-source/dependency-track-uploader:dtrackuploader-v0.2.1",
|
|
1855
|
+
"interruptible": true,
|
|
1856
|
+
"needs": [
|
|
1857
|
+
"www 🧾 sbom | prod ",
|
|
1858
|
+
],
|
|
1859
|
+
"retry": {
|
|
1860
|
+
"max": 2,
|
|
1861
|
+
"when": [
|
|
1862
|
+
"runner_system_failure",
|
|
1863
|
+
"stuck_or_timeout_failure",
|
|
1864
|
+
],
|
|
1865
|
+
},
|
|
1866
|
+
"script": [
|
|
1867
|
+
"/dtrackuploader https://dep.panter.dev/ "$DT_KEY" upload "pan-test-app/www" "prod" "__sbom.json" vex.json",
|
|
1868
|
+
],
|
|
1869
|
+
"stage": "verify",
|
|
1870
|
+
"variables": {},
|
|
1871
|
+
},
|
|
1872
|
+
"www 🧾 sbom upload | stage ": {
|
|
1873
|
+
"allow_failure": true,
|
|
1874
|
+
"cache": undefined,
|
|
1875
|
+
"environment": undefined,
|
|
1876
|
+
"image": "git.panter.ch:5001/open-source/dependency-track-uploader:dtrackuploader-v0.2.1",
|
|
1877
|
+
"interruptible": true,
|
|
1878
|
+
"needs": [
|
|
1879
|
+
"www 🧾 sbom | stage ",
|
|
1880
|
+
],
|
|
1881
|
+
"retry": {
|
|
1882
|
+
"max": 2,
|
|
1883
|
+
"when": [
|
|
1884
|
+
"runner_system_failure",
|
|
1885
|
+
"stuck_or_timeout_failure",
|
|
1886
|
+
],
|
|
1887
|
+
},
|
|
1888
|
+
"script": [
|
|
1889
|
+
"/dtrackuploader https://dep.panter.dev/ "$DT_KEY" upload "pan-test-app/www" "stage" "__sbom.json" vex.json",
|
|
1890
|
+
],
|
|
1891
|
+
"stage": "verify",
|
|
1892
|
+
"variables": {},
|
|
1893
|
+
},
|
|
1894
|
+
"www 🧾 sbom | prod ": {
|
|
1895
|
+
"allow_failure": true,
|
|
1896
|
+
"artifacts": {
|
|
1897
|
+
"paths": [
|
|
1898
|
+
"__sbom.json",
|
|
1899
|
+
],
|
|
1900
|
+
},
|
|
1901
|
+
"cache": undefined,
|
|
1902
|
+
"environment": undefined,
|
|
1903
|
+
"image": "aquasec/trivy:0.38.3",
|
|
1904
|
+
"interruptible": true,
|
|
1905
|
+
"needs": [
|
|
1906
|
+
"www 🚀 Deploy | prod ",
|
|
1907
|
+
],
|
|
1908
|
+
"retry": {
|
|
1909
|
+
"max": 2,
|
|
1910
|
+
"when": [
|
|
1911
|
+
"runner_system_failure",
|
|
1912
|
+
"stuck_or_timeout_failure",
|
|
1913
|
+
],
|
|
1914
|
+
},
|
|
1915
|
+
"script": [
|
|
1916
|
+
"trivy fs --quiet --format cyclonedx --output "__sbom.json" www",
|
|
1917
|
+
],
|
|
1918
|
+
"stage": "verify",
|
|
1919
|
+
"variables": {},
|
|
1920
|
+
},
|
|
1921
|
+
"www 🧾 sbom | stage ": {
|
|
1922
|
+
"allow_failure": true,
|
|
1923
|
+
"artifacts": {
|
|
1924
|
+
"paths": [
|
|
1925
|
+
"__sbom.json",
|
|
1926
|
+
],
|
|
1927
|
+
},
|
|
1928
|
+
"cache": undefined,
|
|
1929
|
+
"environment": undefined,
|
|
1930
|
+
"image": "aquasec/trivy:0.38.3",
|
|
1931
|
+
"interruptible": true,
|
|
1932
|
+
"needs": [
|
|
1933
|
+
"www 🚀 Deploy | stage ",
|
|
1934
|
+
],
|
|
1935
|
+
"retry": {
|
|
1936
|
+
"max": 2,
|
|
1937
|
+
"when": [
|
|
1938
|
+
"runner_system_failure",
|
|
1939
|
+
"stuck_or_timeout_failure",
|
|
1940
|
+
],
|
|
1941
|
+
},
|
|
1942
|
+
"script": [
|
|
1943
|
+
"trivy fs --quiet --format cyclonedx --output "__sbom.json" www",
|
|
1944
|
+
],
|
|
1945
|
+
"stage": "verify",
|
|
1946
|
+
"variables": {},
|
|
1947
|
+
},
|
|
1556
1948
|
},
|
|
1557
1949
|
"stages": [
|
|
1558
1950
|
"setup",
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Config } from "../src";
|
|
2
|
+
import { createAllPipelines } from "./__utils__/helpers";
|
|
3
|
+
|
|
4
|
+
const config: Config = {
|
|
5
|
+
appName: "test-app",
|
|
6
|
+
customerName: "pan",
|
|
7
|
+
components: {
|
|
8
|
+
app: {
|
|
9
|
+
dir: ".",
|
|
10
|
+
build: {
|
|
11
|
+
type: "custom",
|
|
12
|
+
docker: { type: "custom" },
|
|
13
|
+
jobImage: "maven:3-eclipse-temurin-11",
|
|
14
|
+
buildCommand: ["mvn package", "cp -r target dist"],
|
|
15
|
+
sbom: {
|
|
16
|
+
jobImage: "maven:3-eclipse-temurin-11",
|
|
17
|
+
command: [
|
|
18
|
+
"mvn org.cyclonedx:cyclonedx-maven-plugin:2.7.4:makeBom",
|
|
19
|
+
"mv target/bom.json __sbom.json",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
deploy: {
|
|
24
|
+
type: "google-cloudrun",
|
|
25
|
+
projectId: "asdf",
|
|
26
|
+
region: "asia-east1",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
it("matches snapshot", async () => {
|
|
33
|
+
expect(await createAllPipelines(config)).toMatchSnapshot();
|
|
34
|
+
});
|
package/package.json
CHANGED
package/src/build/types.ts
CHANGED
|
@@ -149,6 +149,19 @@ export type BuildConfigCustom = Omit<
|
|
|
149
149
|
command?: string | string[];
|
|
150
150
|
jobImage?: GitlabJobImage;
|
|
151
151
|
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* custom sbom (software bill of materials), set false to disable
|
|
155
|
+
*/
|
|
156
|
+
sbom?:
|
|
157
|
+
| false
|
|
158
|
+
| {
|
|
159
|
+
/**
|
|
160
|
+
* needs to create a file at `/__sbom.json` in CycloneDX format
|
|
161
|
+
*/
|
|
162
|
+
command: string | string[];
|
|
163
|
+
jobImage: GitlabJobImage;
|
|
164
|
+
};
|
|
152
165
|
};
|
|
153
166
|
|
|
154
167
|
export type BuildConfigRails = BuildConfigBase & {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isFunction } from "lodash";
|
|
2
2
|
import { BUILD_TYPES } from "../build";
|
|
3
|
+
import { createReportingJobs } from "../verify/reporting";
|
|
3
4
|
import { createContext } from "../context";
|
|
4
5
|
import { DEPLOY_TYPES } from "../deploy";
|
|
5
6
|
import type { Config, PipelineTrigger } from "../types/config";
|
|
@@ -36,9 +37,10 @@ const createRawJobs = (context: Context): CatladderJob[] => {
|
|
|
36
37
|
BUILD_TYPES[context.componentConfig.build.type].jobs(context);
|
|
37
38
|
const deployJobs =
|
|
38
39
|
DEPLOY_TYPES[context.componentConfig.deploy.type].jobs(context);
|
|
40
|
+
const reportingJobs = createReportingJobs(context);
|
|
39
41
|
|
|
40
42
|
const customJobs = getCustomJobs(context);
|
|
41
|
-
return [...buildJobs, ...deployJobs, ...customJobs];
|
|
43
|
+
return [...buildJobs, ...deployJobs, ...reportingJobs, ...customJobs];
|
|
42
44
|
};
|
|
43
45
|
export const createJobsForComponent = async (
|
|
44
46
|
config: Config,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { DEPLOY_JOB_NAME } from "../deploy/base";
|
|
2
|
+
import type { Context } from "../types/context";
|
|
3
|
+
import type { CatladderJob } from "../types/jobs";
|
|
4
|
+
import { ensureArray } from "../utils";
|
|
5
|
+
|
|
6
|
+
const STAGE = "verify";
|
|
7
|
+
const SBOM_GENERATE_JOB_NAME = "🧾 sbom";
|
|
8
|
+
const SBOM_FILE = "__sbom.json";
|
|
9
|
+
|
|
10
|
+
const createSbomGenerateJob = (context: Context): CatladderJob => {
|
|
11
|
+
const buildConfig = context.componentConfig.build;
|
|
12
|
+
|
|
13
|
+
const defaultImage = "aquasec/trivy:0.38.3";
|
|
14
|
+
const defaultScript = [
|
|
15
|
+
`trivy fs --quiet --format cyclonedx --output "${SBOM_FILE}" ${
|
|
16
|
+
context.packageManagerInfo?.componentIsInWorkspace
|
|
17
|
+
? "."
|
|
18
|
+
: context.componentConfig.dir
|
|
19
|
+
}`,
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
const image =
|
|
23
|
+
buildConfig.type === "custom" && buildConfig.sbom !== false
|
|
24
|
+
? buildConfig.sbom?.jobImage ?? defaultImage
|
|
25
|
+
: defaultImage;
|
|
26
|
+
|
|
27
|
+
const script =
|
|
28
|
+
buildConfig.type === "custom" && buildConfig.sbom !== false
|
|
29
|
+
? ensureArray(buildConfig.sbom?.command) ?? defaultScript
|
|
30
|
+
: defaultScript;
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
name: SBOM_GENERATE_JOB_NAME,
|
|
34
|
+
stage: STAGE,
|
|
35
|
+
needs: context.componentConfig.deploy !== false ? [DEPLOY_JOB_NAME] : [],
|
|
36
|
+
envMode: "jobPerEnv",
|
|
37
|
+
variables: {},
|
|
38
|
+
cache: undefined,
|
|
39
|
+
image,
|
|
40
|
+
script,
|
|
41
|
+
allow_failure: true,
|
|
42
|
+
artifacts: {
|
|
43
|
+
paths: [SBOM_FILE],
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const createSbomUploadJob = (context: Context): CatladderJob => {
|
|
49
|
+
return {
|
|
50
|
+
name: "🧾 sbom upload",
|
|
51
|
+
stage: STAGE,
|
|
52
|
+
needs: [SBOM_GENERATE_JOB_NAME],
|
|
53
|
+
envMode: "jobPerEnv",
|
|
54
|
+
variables: {},
|
|
55
|
+
cache: undefined,
|
|
56
|
+
image:
|
|
57
|
+
"git.panter.ch:5001/open-source/dependency-track-uploader:dtrackuploader-v0.2.1",
|
|
58
|
+
script: [
|
|
59
|
+
`/dtrackuploader https://dep.panter.dev/ "$DT_KEY" upload "${context.fullConfig.customerName}-${context.fullConfig.appName}/${context.componentName}" "${context.environment.shortName}" "${SBOM_FILE}" vex.json`,
|
|
60
|
+
],
|
|
61
|
+
allow_failure: true,
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const createReportingJobs = (context: Context) =>
|
|
66
|
+
context.componentConfig.build.type === "custom" &&
|
|
67
|
+
context.componentConfig.build.sbom === false
|
|
68
|
+
? []
|
|
69
|
+
: [createSbomGenerateJob(context), createSbomUploadJob(context)];
|