@catladder/pipeline 2.0.4 → 2.1.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/base/writeDotEnv.js +0 -1
- package/dist/build/docker.js +0 -1
- package/dist/build/node/meteor.js +0 -1
- package/dist/build/rails/test.js +0 -1
- package/dist/catladder-gitlab.js +2 -3
- package/dist/config/readConfig.js +0 -1
- package/dist/constants.js +1 -1
- package/dist/context/getEnvironmentVariables.js +0 -1
- package/dist/context/getReviewSlug.js +0 -1
- package/dist/deploy/cloudRun/createJobs/cloudRunJobs.js +3 -9
- package/dist/deploy/cloudRun/createJobs/cloudRunServices.js +1 -3
- package/dist/deploy/cloudRun/createJobs/index.js +0 -1
- package/dist/deploy/kubernetes/deployJob.js +0 -1
- package/dist/deploy/types/index.d.ts +3 -3
- package/dist/pipeline/generatePipelineFiles.d.ts +3 -22
- package/dist/pipeline/generatePipelineFiles.js +4 -39
- package/dist/pipeline/gitlab/gitlabReleaseJobs.d.ts +0 -2
- package/dist/pipeline/gitlab/gitlabReleaseJobs.js +2 -4
- package/dist/pipeline/index.d.ts +0 -1
- package/dist/pipeline/index.js +0 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/pipeline.d.ts +0 -1
- package/dist/utils/writeFiles.js +0 -2
- package/dist/variables/__tests__/resolveAllReferences.test.js +0 -1
- package/dist/variables/__tests__/resolveReferencesOnce.test.js +0 -3
- package/examples/__snapshots__/cloud-run-http2.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-memory-limit.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-meteor-with-worker.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-nextjs.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +4 -6
- package/examples/__snapshots__/cloud-run-non-public.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +1 -3
- package/examples/__snapshots__/cloud-run-service-custom-vpc-connector.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-service-custom-vpc.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-service-gen2.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-service-increase-timout.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +12 -14
- package/examples/__snapshots__/cloud-run-storybook.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-with-ngnix.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +8 -10
- package/examples/__snapshots__/cloud-run-with-worker.test.ts.snap +0 -2
- package/examples/__snapshots__/custom-build-job-with-tests.test.ts.snap +0 -2
- package/examples/__snapshots__/custom-build-job.test.ts.snap +0 -2
- package/examples/__snapshots__/custom-deploy.test.ts.snap +0 -2
- package/examples/__snapshots__/custom-envs.test.ts.snap +0 -2
- package/examples/__snapshots__/custom-sbom-java.test.ts.snap +0 -2
- package/examples/__snapshots__/git-submodule.test.ts.snap +0 -2
- package/examples/__snapshots__/kubernetes-application-customization.test.ts.snap +0 -2
- package/examples/__snapshots__/kubernetes-with-cloud-sql.test.ts.snap +0 -2
- package/examples/__snapshots__/kubernetes-with-jobs.test.ts.snap +0 -2
- package/examples/__snapshots__/kubernetes-with-mongodb.test.ts.snap +0 -2
- package/examples/__snapshots__/local-dot-env.test.ts.snap +0 -2
- package/examples/__snapshots__/meteor-kubernetes.test.ts.snap +0 -2
- package/examples/__snapshots__/multiline-var.test.ts.snap +0 -2
- package/examples/__snapshots__/native-app.test.ts.snap +0 -2
- package/examples/__snapshots__/node-build-with-custom-image.test.ts.snap +0 -2
- package/examples/__snapshots__/node-build-with-docker-additions.test.ts.snap +0 -2
- package/examples/__snapshots__/rails-k8s-with-worker-dockerfile.test.ts.snap +0 -2
- package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +0 -2
- package/examples/__snapshots__/referencing-other-vars.test.ts.snap +0 -2
- package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +0 -2
- package/examples/__snapshots__/workspace-api-www-turbo-cache.test.ts.snap +0 -2
- package/examples/__snapshots__/workspace-api-www.test.ts.snap +0 -2
- package/examples/__utils__/helpers.ts +1 -17
- package/package.json +16 -17
- package/src/build/cache/createJobCache.ts +2 -2
- package/src/build/sbom.ts +2 -2
- package/src/catladder-gitlab.ts +2 -9
- package/src/config/readConfig.ts +0 -1
- package/src/context/createComponentContext.ts +1 -1
- package/src/context/getEnvironmentVariables.ts +1 -1
- package/src/deploy/base/deploy.ts +3 -3
- package/src/deploy/cloudRun/createJobs/cloudRunJobs.ts +18 -24
- package/src/deploy/cloudRun/createJobs/cloudRunServices.ts +2 -7
- package/src/pipeline/generatePipelineFiles.ts +1 -37
- package/src/pipeline/gitlab/gitlabReleaseJobs.ts +2 -4
- package/src/pipeline/index.ts +0 -1
- package/src/types/pipeline.ts +0 -4
- package/dist/pipeline/createChildPipeline.d.ts +0 -3
- package/dist/pipeline/createChildPipeline.js +0 -163
- package/dist/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.d.ts +0 -1
- package/dist/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.js +0 -29
- package/src/pipeline/createChildPipeline.ts +0 -37
- package/src/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.ts +0 -46
|
@@ -3325,7 +3325,6 @@ create release:
|
|
|
3325
3325
|
image: path/to/docker/semantic-release:the-version
|
|
3326
3326
|
script:
|
|
3327
3327
|
- semanticRelease
|
|
3328
|
-
after_script:
|
|
3329
3328
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
3330
3329
|
rules:
|
|
3331
3330
|
- &a2
|
|
@@ -3345,7 +3344,6 @@ create release:
|
|
|
3345
3344
|
image: path/to/docker/semantic-release:the-version
|
|
3346
3345
|
script:
|
|
3347
3346
|
- semanticRelease
|
|
3348
|
-
after_script:
|
|
3349
3347
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
3350
3348
|
rules:
|
|
3351
3349
|
- *a2
|
|
@@ -1851,7 +1851,6 @@ create release:
|
|
|
1851
1851
|
image: path/to/docker/semantic-release:the-version
|
|
1852
1852
|
script:
|
|
1853
1853
|
- semanticRelease
|
|
1854
|
-
after_script:
|
|
1855
1854
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
1856
1855
|
rules:
|
|
1857
1856
|
- &a2
|
|
@@ -1871,7 +1870,6 @@ create release:
|
|
|
1871
1870
|
image: path/to/docker/semantic-release:the-version
|
|
1872
1871
|
script:
|
|
1873
1872
|
- semanticRelease
|
|
1874
|
-
after_script:
|
|
1875
1873
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
1876
1874
|
rules:
|
|
1877
1875
|
- *a2
|
|
@@ -1310,7 +1310,6 @@ create release:
|
|
|
1310
1310
|
image: path/to/docker/semantic-release:the-version
|
|
1311
1311
|
script:
|
|
1312
1312
|
- semanticRelease
|
|
1313
|
-
after_script:
|
|
1314
1313
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
1315
1314
|
rules:
|
|
1316
1315
|
- &a2
|
|
@@ -1330,7 +1329,6 @@ create release:
|
|
|
1330
1329
|
image: path/to/docker/semantic-release:the-version
|
|
1331
1330
|
script:
|
|
1332
1331
|
- semanticRelease
|
|
1333
|
-
after_script:
|
|
1334
1332
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
1335
1333
|
rules:
|
|
1336
1334
|
- *a2
|
|
@@ -1804,7 +1804,6 @@ create release:
|
|
|
1804
1804
|
image: path/to/docker/semantic-release:the-version
|
|
1805
1805
|
script:
|
|
1806
1806
|
- semanticRelease
|
|
1807
|
-
after_script:
|
|
1808
1807
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
1809
1808
|
rules:
|
|
1810
1809
|
- &a2
|
|
@@ -1824,7 +1823,6 @@ create release:
|
|
|
1824
1823
|
image: path/to/docker/semantic-release:the-version
|
|
1825
1824
|
script:
|
|
1826
1825
|
- semanticRelease
|
|
1827
|
-
after_script:
|
|
1828
1826
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
1829
1827
|
rules:
|
|
1830
1828
|
- *a2
|
|
@@ -5647,7 +5647,6 @@ create release:
|
|
|
5647
5647
|
image: path/to/docker/semantic-release:the-version
|
|
5648
5648
|
script:
|
|
5649
5649
|
- semanticRelease
|
|
5650
|
-
after_script:
|
|
5651
5650
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
5652
5651
|
rules:
|
|
5653
5652
|
- &a2
|
|
@@ -5667,7 +5666,6 @@ create release:
|
|
|
5667
5666
|
image: path/to/docker/semantic-release:the-version
|
|
5668
5667
|
script:
|
|
5669
5668
|
- semanticRelease
|
|
5670
|
-
after_script:
|
|
5671
5669
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
5672
5670
|
rules:
|
|
5673
5671
|
- *a2
|
|
@@ -2174,7 +2174,6 @@ create release:
|
|
|
2174
2174
|
image: path/to/docker/semantic-release:the-version
|
|
2175
2175
|
script:
|
|
2176
2176
|
- semanticRelease
|
|
2177
|
-
after_script:
|
|
2178
2177
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
2179
2178
|
rules:
|
|
2180
2179
|
- &a2
|
|
@@ -2194,7 +2193,6 @@ create release:
|
|
|
2194
2193
|
image: path/to/docker/semantic-release:the-version
|
|
2195
2194
|
script:
|
|
2196
2195
|
- semanticRelease
|
|
2197
|
-
after_script:
|
|
2198
2196
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
2199
2197
|
rules:
|
|
2200
2198
|
- *a2
|
|
@@ -1386,7 +1386,6 @@ create release:
|
|
|
1386
1386
|
image: path/to/docker/semantic-release:the-version
|
|
1387
1387
|
script:
|
|
1388
1388
|
- semanticRelease
|
|
1389
|
-
after_script:
|
|
1390
1389
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
1391
1390
|
rules:
|
|
1392
1391
|
- &a2
|
|
@@ -1406,7 +1405,6 @@ create release:
|
|
|
1406
1405
|
image: path/to/docker/semantic-release:the-version
|
|
1407
1406
|
script:
|
|
1408
1407
|
- semanticRelease
|
|
1409
|
-
after_script:
|
|
1410
1408
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
1411
1409
|
rules:
|
|
1412
1410
|
- *a2
|
|
@@ -1394,7 +1394,6 @@ create release:
|
|
|
1394
1394
|
image: path/to/docker/semantic-release:the-version
|
|
1395
1395
|
script:
|
|
1396
1396
|
- semanticRelease
|
|
1397
|
-
after_script:
|
|
1398
1397
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
1399
1398
|
rules:
|
|
1400
1399
|
- &a2
|
|
@@ -1414,7 +1413,6 @@ create release:
|
|
|
1414
1413
|
image: path/to/docker/semantic-release:the-version
|
|
1415
1414
|
script:
|
|
1416
1415
|
- semanticRelease
|
|
1417
|
-
after_script:
|
|
1418
1416
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
1419
1417
|
rules:
|
|
1420
1418
|
- *a2
|
|
@@ -1455,7 +1455,6 @@ create release:
|
|
|
1455
1455
|
image: path/to/docker/semantic-release:the-version
|
|
1456
1456
|
script:
|
|
1457
1457
|
- semanticRelease
|
|
1458
|
-
after_script:
|
|
1459
1458
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
1460
1459
|
rules:
|
|
1461
1460
|
- &a3
|
|
@@ -1475,7 +1474,6 @@ create release:
|
|
|
1475
1474
|
image: path/to/docker/semantic-release:the-version
|
|
1476
1475
|
script:
|
|
1477
1476
|
- semanticRelease
|
|
1478
|
-
after_script:
|
|
1479
1477
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
1480
1478
|
rules:
|
|
1481
1479
|
- *a3
|
|
@@ -1439,7 +1439,6 @@ create release:
|
|
|
1439
1439
|
image: path/to/docker/semantic-release:the-version
|
|
1440
1440
|
script:
|
|
1441
1441
|
- semanticRelease
|
|
1442
|
-
after_script:
|
|
1443
1442
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
1444
1443
|
rules:
|
|
1445
1444
|
- &a3
|
|
@@ -1459,7 +1458,6 @@ create release:
|
|
|
1459
1458
|
image: path/to/docker/semantic-release:the-version
|
|
1460
1459
|
script:
|
|
1461
1460
|
- semanticRelease
|
|
1462
|
-
after_script:
|
|
1463
1461
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
1464
1462
|
rules:
|
|
1465
1463
|
- *a3
|
|
@@ -4707,7 +4707,6 @@ create release:
|
|
|
4707
4707
|
image: path/to/docker/semantic-release:the-version
|
|
4708
4708
|
script:
|
|
4709
4709
|
- semanticRelease
|
|
4710
|
-
after_script:
|
|
4711
4710
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
4712
4711
|
rules:
|
|
4713
4712
|
- &a2
|
|
@@ -4727,7 +4726,6 @@ create release:
|
|
|
4727
4726
|
image: path/to/docker/semantic-release:the-version
|
|
4728
4727
|
script:
|
|
4729
4728
|
- semanticRelease
|
|
4730
|
-
after_script:
|
|
4731
4729
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
4732
4730
|
rules:
|
|
4733
4731
|
- *a2
|
|
@@ -1336,7 +1336,6 @@ create release:
|
|
|
1336
1336
|
image: path/to/docker/semantic-release:the-version
|
|
1337
1337
|
script:
|
|
1338
1338
|
- semanticRelease
|
|
1339
|
-
after_script:
|
|
1340
1339
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
1341
1340
|
rules:
|
|
1342
1341
|
- &a2
|
|
@@ -1356,7 +1355,6 @@ create release:
|
|
|
1356
1355
|
image: path/to/docker/semantic-release:the-version
|
|
1357
1356
|
script:
|
|
1358
1357
|
- semanticRelease
|
|
1359
|
-
after_script:
|
|
1360
1358
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
1361
1359
|
rules:
|
|
1362
1360
|
- *a2
|
|
@@ -2306,7 +2306,6 @@ create release:
|
|
|
2306
2306
|
image: path/to/docker/semantic-release:the-version
|
|
2307
2307
|
script:
|
|
2308
2308
|
- semanticRelease
|
|
2309
|
-
after_script:
|
|
2310
2309
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
2311
2310
|
rules:
|
|
2312
2311
|
- &a2
|
|
@@ -2326,7 +2325,6 @@ create release:
|
|
|
2326
2325
|
image: path/to/docker/semantic-release:the-version
|
|
2327
2326
|
script:
|
|
2328
2327
|
- semanticRelease
|
|
2329
|
-
after_script:
|
|
2330
2328
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
2331
2329
|
rules:
|
|
2332
2330
|
- *a2
|
|
@@ -2298,7 +2298,6 @@ create release:
|
|
|
2298
2298
|
image: path/to/docker/semantic-release:the-version
|
|
2299
2299
|
script:
|
|
2300
2300
|
- semanticRelease
|
|
2301
|
-
after_script:
|
|
2302
2301
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
2303
2302
|
rules:
|
|
2304
2303
|
- &a2
|
|
@@ -2318,7 +2317,6 @@ create release:
|
|
|
2318
2317
|
image: path/to/docker/semantic-release:the-version
|
|
2319
2318
|
script:
|
|
2320
2319
|
- semanticRelease
|
|
2321
|
-
after_script:
|
|
2322
2320
|
- echo '👉 The project access token might be invald - run \`project-renew-token\` in catladder CLI to fix.'
|
|
2323
2321
|
rules:
|
|
2324
2322
|
- *a2
|
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
import { stringify } from "yaml";
|
|
2
2
|
|
|
3
3
|
import type { Config } from "../../src";
|
|
4
|
-
import {
|
|
5
|
-
createChildPipeline,
|
|
6
|
-
generateLocalPipelineContent,
|
|
7
|
-
yamlStringifyOptions,
|
|
8
|
-
} from "../../src";
|
|
9
|
-
|
|
10
|
-
const ALL_TRIGGERS = ["mainBranch", "taggedRelease", "mr"] as const;
|
|
11
|
-
|
|
12
|
-
export const createAllPipelines = async (config: Config) =>
|
|
13
|
-
Object.fromEntries(
|
|
14
|
-
await Promise.all(
|
|
15
|
-
ALL_TRIGGERS.map(async (trigger) => [
|
|
16
|
-
trigger,
|
|
17
|
-
await createChildPipeline("gitlab", trigger, config),
|
|
18
|
-
]),
|
|
19
|
-
),
|
|
20
|
-
);
|
|
4
|
+
import { generateLocalPipelineContent, yamlStringifyOptions } from "../../src";
|
|
21
5
|
|
|
22
6
|
export const createYamlLocalPipeline = async (
|
|
23
7
|
config: Config,
|
package/package.json
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
55
|
"license": "MIT",
|
|
56
|
-
"version": "2.0
|
|
56
|
+
"version": "2.1.0",
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build:tsc": "yarn tsc",
|
|
59
59
|
"build": "yarn build:compile && yarn build:inline-variables",
|
|
@@ -69,28 +69,27 @@
|
|
|
69
69
|
"main": "dist/index.js",
|
|
70
70
|
"sideEffects": false,
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@babel/cli": "^7.
|
|
73
|
-
"@babel/core": "^7.
|
|
74
|
-
"@babel/plugin-syntax-typescript": "^7.
|
|
75
|
-
"@babel/preset-typescript": "^7.
|
|
76
|
-
"@jest/globals": "^29.
|
|
77
|
-
"@types/child-process-promise": "^2.2.
|
|
78
|
-
"@types/jest": "^
|
|
79
|
-
"@types/lodash": "^4.
|
|
80
|
-
"@types/node": "^
|
|
72
|
+
"@babel/cli": "^7.24.8",
|
|
73
|
+
"@babel/core": "^7.25.2",
|
|
74
|
+
"@babel/plugin-syntax-typescript": "^7.25.4",
|
|
75
|
+
"@babel/preset-typescript": "^7.24.7",
|
|
76
|
+
"@jest/globals": "^29.7.0",
|
|
77
|
+
"@types/child-process-promise": "^2.2.6",
|
|
78
|
+
"@types/jest": "^29.5.12",
|
|
79
|
+
"@types/lodash": "^4.17.7",
|
|
80
|
+
"@types/node": "^22.5.1",
|
|
81
81
|
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
|
|
82
82
|
"child-process-promise": "^2.2.1",
|
|
83
|
-
"glob": "^
|
|
83
|
+
"glob": "^11.0.0",
|
|
84
84
|
"json-schema-to-typescript": "^13.0.2",
|
|
85
85
|
"lodash": "^4.17.21",
|
|
86
|
-
"memoizee": "^0.4.
|
|
87
|
-
"path-equal": "1.
|
|
88
|
-
"slugify": "^1.6.
|
|
89
|
-
"tsx": "^4.16.2",
|
|
86
|
+
"memoizee": "^0.4.17",
|
|
87
|
+
"path-equal": "1.2.5",
|
|
88
|
+
"slugify": "^1.6.6",
|
|
90
89
|
"typescript": "^5.4.5",
|
|
91
|
-
"yaml": "^2.
|
|
90
|
+
"yaml": "^2.5.0"
|
|
92
91
|
},
|
|
93
92
|
"dependencies": {
|
|
94
|
-
"tsx": "^4.
|
|
93
|
+
"tsx": "^4.19.0"
|
|
95
94
|
}
|
|
96
95
|
}
|
|
@@ -30,7 +30,7 @@ export const createJobCacheFromCacheConfigs = (
|
|
|
30
30
|
const baseDir =
|
|
31
31
|
c.pathMode === "absolute"
|
|
32
32
|
? ""
|
|
33
|
-
: c.baseDir ?? context.build.dir;
|
|
33
|
+
: (c.baseDir ?? context.build.dir);
|
|
34
34
|
return join(baseDir, p);
|
|
35
35
|
}),
|
|
36
36
|
),
|
|
@@ -41,7 +41,7 @@ export const createJobCacheFromCacheConfigs = (
|
|
|
41
41
|
const advancedCaches = advancedCacheDefs.map(
|
|
42
42
|
({ key, paths, policy, scope, pathMode, buildDir, ...rest }) => {
|
|
43
43
|
const baseDir =
|
|
44
|
-
pathMode === "absolute" ? "" : buildDir ?? context.build.dir;
|
|
44
|
+
pathMode === "absolute" ? "" : (buildDir ?? context.build.dir);
|
|
45
45
|
const transformedKey =
|
|
46
46
|
scope === "global"
|
|
47
47
|
? key
|
package/src/build/sbom.ts
CHANGED
|
@@ -22,14 +22,14 @@ export const createSbomBuildJob = (context: ComponentContext): CatladderJob => {
|
|
|
22
22
|
isStandaloneBuildConfig(buildConfig) &&
|
|
23
23
|
buildConfig.type === "custom" &&
|
|
24
24
|
buildConfig.sbom !== false
|
|
25
|
-
? buildConfig.sbom?.jobImage ?? defaultImage
|
|
25
|
+
? (buildConfig.sbom?.jobImage ?? defaultImage)
|
|
26
26
|
: defaultImage;
|
|
27
27
|
|
|
28
28
|
const script =
|
|
29
29
|
isStandaloneBuildConfig(buildConfig) &&
|
|
30
30
|
buildConfig.type === "custom" &&
|
|
31
31
|
buildConfig.sbom !== false
|
|
32
|
-
? ensureArrayOrNull(buildConfig.sbom?.command) ?? defaultScript
|
|
32
|
+
? (ensureArrayOrNull(buildConfig.sbom?.command) ?? defaultScript)
|
|
33
33
|
: defaultScript;
|
|
34
34
|
|
|
35
35
|
return {
|
package/src/catladder-gitlab.ts
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { readConfig } from "./config";
|
|
2
2
|
import { generatePipelineFiles } from "./pipeline/generatePipelineFiles";
|
|
3
|
-
import type { PipelineMode } from "./types";
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const config = readConfig().then(async (result) => {
|
|
4
|
+
readConfig().then(async (result) => {
|
|
8
5
|
if (!result?.config) {
|
|
9
6
|
throw new Error("no catladder config found");
|
|
10
7
|
}
|
|
11
8
|
|
|
12
|
-
await generatePipelineFiles(
|
|
13
|
-
result.config,
|
|
14
|
-
"gitlab",
|
|
15
|
-
mode as PipelineMode<"gitlab">,
|
|
16
|
-
);
|
|
9
|
+
await generatePipelineFiles(result.config, "gitlab");
|
|
17
10
|
});
|
package/src/config/readConfig.ts
CHANGED
|
@@ -76,7 +76,7 @@ export const createComponentContext = async (
|
|
|
76
76
|
dir,
|
|
77
77
|
// also copy workspace dependencies in monorepo if packages are shared and they create build artifacts
|
|
78
78
|
...(mode === "all"
|
|
79
|
-
? packageManagerInfo.currentWorkspaceDependencies ?? []
|
|
79
|
+
? (packageManagerInfo.currentWorkspaceDependencies ?? [])
|
|
80
80
|
: []),
|
|
81
81
|
];
|
|
82
82
|
const _getBuildContext = (): BuildContextComponent => {
|
|
@@ -134,7 +134,7 @@ export const getEnvironmentVariables = async (
|
|
|
134
134
|
);
|
|
135
135
|
|
|
136
136
|
const publicEnvVars =
|
|
137
|
-
options.shouldResolveReferences ?? true
|
|
137
|
+
(options.shouldResolveReferences ?? true)
|
|
138
138
|
? await resolveAllReferences(
|
|
139
139
|
publicEnvVarsUnresolved,
|
|
140
140
|
async (otherComponentName) => {
|
|
@@ -62,11 +62,11 @@ export const createDeployJob = (
|
|
|
62
62
|
? []
|
|
63
63
|
: [{ job: SBOM_BUILD_JOB_NAME, artifacts: true }]),
|
|
64
64
|
...(deployConfig
|
|
65
|
-
? deployConfig.waitFor?.map((c) => ({
|
|
65
|
+
? (deployConfig.waitFor?.map((c) => ({
|
|
66
66
|
componentName: c,
|
|
67
67
|
job: DEPLOY_JOB_NAME,
|
|
68
68
|
artifacts: false,
|
|
69
|
-
})) ?? []
|
|
69
|
+
})) ?? [])
|
|
70
70
|
: []),
|
|
71
71
|
],
|
|
72
72
|
// we don't want to deploy when there is a broken test
|
|
@@ -117,7 +117,7 @@ export const createDeployJob = (
|
|
|
117
117
|
runnerVariables: {
|
|
118
118
|
...DEPLOY_RUNNER_VARIABLES,
|
|
119
119
|
...(jobDefinition.runnerVariables ?? {}),
|
|
120
|
-
...(deployConfig ? deployConfig.runnerVariables ?? {} : {}),
|
|
120
|
+
...(deployConfig ? (deployConfig.runnerVariables ?? {}) : {}),
|
|
121
121
|
},
|
|
122
122
|
environment: isStoppable
|
|
123
123
|
? {
|
|
@@ -108,29 +108,23 @@ export const getJobCreateScripts = (context: ComponentContext): string[] =>
|
|
|
108
108
|
region,
|
|
109
109
|
...deployArgs
|
|
110
110
|
} = getCommonDeployArgs(context);
|
|
111
|
-
const commonDeployArgsString = createArgsString(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
// we cannot upsert a job, so we have to create it and catch the error and then update
|
|
129
|
-
const hasVolumes = Object.keys(volumes || {}).length > 0;
|
|
130
|
-
const needsBeta = hasVolumes ? "beta" : undefined;
|
|
131
|
-
const volumeArgs = hasVolumes
|
|
132
|
-
? createArgsString(...createVolumeConfig(volumes, "job"))
|
|
133
|
-
: "";
|
|
111
|
+
const commonDeployArgsString = createArgsString(
|
|
112
|
+
{
|
|
113
|
+
command: `"${commandArray.join(",")}"`,
|
|
114
|
+
labels: `"${makeLabelString(getLabels(context))},cloud-run-job-name=$current_job_name"`,
|
|
115
|
+
image: `"${image ?? commonImage}"`,
|
|
116
|
+
project,
|
|
117
|
+
region,
|
|
118
|
+
cpu,
|
|
119
|
+
memory,
|
|
120
|
+
parallelism,
|
|
121
|
+
"task-timeout": timeout,
|
|
122
|
+
"env-vars-file": ENV_VARS_FILENAME,
|
|
123
|
+
"max-retries": 0,
|
|
124
|
+
...deployArgs,
|
|
125
|
+
},
|
|
126
|
+
...createVolumeConfig(volumes, "job"),
|
|
127
|
+
);
|
|
134
128
|
|
|
135
129
|
return [
|
|
136
130
|
jobIndex === 0
|
|
@@ -138,7 +132,7 @@ export const getJobCreateScripts = (context: ComponentContext): string[] =>
|
|
|
138
132
|
: null,
|
|
139
133
|
`current_job_name="${jobName}"`,
|
|
140
134
|
'if grep "$current_job_name" <<<"$exist_job_names" >/dev/null; then',
|
|
141
|
-
` ${gcloudRunCmd(
|
|
135
|
+
` ${gcloudRunCmd()} jobs update "$current_job_name" ${commonDeployArgsString}`,
|
|
142
136
|
"else",
|
|
143
137
|
` ${gcloudRunCmd()} jobs create "$current_job_name" ${commonDeployArgsString}`,
|
|
144
138
|
"fi",
|
|
@@ -25,7 +25,7 @@ export const getServiceDeployScript = (
|
|
|
25
25
|
const customConfig = service !== true ? service : undefined;
|
|
26
26
|
const command =
|
|
27
27
|
service !== true
|
|
28
|
-
? service?.command ?? context.build.config.startCommand
|
|
28
|
+
? (service?.command ?? context.build.config.startCommand)
|
|
29
29
|
: undefined;
|
|
30
30
|
|
|
31
31
|
const commandArray = command
|
|
@@ -62,13 +62,8 @@ export const getServiceDeployScript = (
|
|
|
62
62
|
},
|
|
63
63
|
...createVolumeConfig(customConfig?.volumes, "service"),
|
|
64
64
|
);
|
|
65
|
-
// volumes require beta
|
|
66
|
-
const requiresBeta =
|
|
67
|
-
customConfig?.volumes && Object.keys(customConfig?.volumes).length > 0;
|
|
68
65
|
|
|
69
|
-
return `${gcloudRunCmd(
|
|
70
|
-
requiresBeta ? "beta" : undefined,
|
|
71
|
-
)} deploy ${fullServiceName} ${argsString}`;
|
|
66
|
+
return `${gcloudRunCmd()} deploy ${fullServiceName} ${argsString}`;
|
|
72
67
|
};
|
|
73
68
|
|
|
74
69
|
export const getServiceDeleteScript = (
|
|
@@ -1,36 +1,8 @@
|
|
|
1
|
-
import type { Config,
|
|
1
|
+
import type { Config, PipelineType } from "../types";
|
|
2
2
|
import { writeYamlfile } from "../utils/writeFiles";
|
|
3
|
-
import { createChildPipeline } from "./createChildPipeline";
|
|
4
3
|
import { createMainPipeline } from "./createMainPipeline";
|
|
5
|
-
import { getPipelineTriggerForGitlabChildPipeline } from "./gitlab/getPipelineTriggerForGitlabChildPipeline";
|
|
6
4
|
import { sortGitLabJobDefProps } from "./gitlab/sortGitLabJobDefProps";
|
|
7
5
|
|
|
8
|
-
export async function generateChildPipelineContent<T extends PipelineType>(
|
|
9
|
-
config: Config,
|
|
10
|
-
pipelineType: T,
|
|
11
|
-
) {
|
|
12
|
-
const trigger = getPipelineTriggerForGitlabChildPipeline();
|
|
13
|
-
const { jobs, image, stages, variables, workflow, ...pipelineRest } =
|
|
14
|
-
await createChildPipeline(pipelineType, trigger, config);
|
|
15
|
-
|
|
16
|
-
const jobsWithSortedProps = Object.fromEntries(
|
|
17
|
-
Object.entries(jobs).map(([jobName, job]) => [
|
|
18
|
-
jobName,
|
|
19
|
-
sortGitLabJobDefProps(job),
|
|
20
|
-
]),
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
image,
|
|
25
|
-
stages,
|
|
26
|
-
variables,
|
|
27
|
-
workflow,
|
|
28
|
-
...pipelineRest,
|
|
29
|
-
// jobs need to be spread into main YAML, because GitLab pipeline YAML has no jobs key - jobs are top level with their key as their name
|
|
30
|
-
...jobsWithSortedProps,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
6
|
export async function generateLocalPipelineContent<T extends PipelineType>(
|
|
35
7
|
config: Config,
|
|
36
8
|
pipelineType: T,
|
|
@@ -59,15 +31,7 @@ export async function generateLocalPipelineContent<T extends PipelineType>(
|
|
|
59
31
|
export async function generatePipelineFiles<T extends PipelineType>(
|
|
60
32
|
config: Config,
|
|
61
33
|
pipelineType: T,
|
|
62
|
-
mode: PipelineMode<T>,
|
|
63
34
|
) {
|
|
64
|
-
if (mode === "childpipeline") {
|
|
65
|
-
const pipelineContent = await generateChildPipelineContent(
|
|
66
|
-
config,
|
|
67
|
-
pipelineType,
|
|
68
|
-
);
|
|
69
|
-
return writeYamlfile(`__pipeline.yml`, pipelineContent);
|
|
70
|
-
}
|
|
71
35
|
const pipelineContent = await generateLocalPipelineContent(
|
|
72
36
|
config,
|
|
73
37
|
pipelineType,
|
|
@@ -9,15 +9,13 @@ export const getGitlabReleaseJobs = () => {
|
|
|
9
9
|
["create release"]: {
|
|
10
10
|
stage: "release",
|
|
11
11
|
image: getRunnerImage("semantic-release"),
|
|
12
|
-
script: ["semanticRelease"],
|
|
13
|
-
after_script: [EXPIRED_TOKEN_HELP],
|
|
12
|
+
script: ["semanticRelease", EXPIRED_TOKEN_HELP],
|
|
14
13
|
rules: RULES_RELEASE,
|
|
15
14
|
},
|
|
16
15
|
["⚠️ force create release"]: {
|
|
17
16
|
stage: "release",
|
|
18
17
|
image: getRunnerImage("semantic-release"),
|
|
19
|
-
script: ["semanticRelease"],
|
|
20
|
-
after_script: [EXPIRED_TOKEN_HELP],
|
|
18
|
+
script: ["semanticRelease", EXPIRED_TOKEN_HELP],
|
|
21
19
|
needs: [],
|
|
22
20
|
rules: RULES_MANUAL_RELEASE,
|
|
23
21
|
},
|
package/src/pipeline/index.ts
CHANGED
package/src/types/pipeline.ts
CHANGED
|
@@ -2,10 +2,6 @@ import type { GitlabJobDef, GitlabPipeline } from "./gitlab-types";
|
|
|
2
2
|
|
|
3
3
|
export type PipelineType = "gitlab";
|
|
4
4
|
|
|
5
|
-
export type PipelineMode<T extends PipelineType> = T extends "gitlab"
|
|
6
|
-
? "childpipeline" | "local"
|
|
7
|
-
: "local";
|
|
8
|
-
|
|
9
5
|
export type PipelineJob<T extends PipelineType> = T extends "gitlab"
|
|
10
6
|
? GitlabJobDef
|
|
11
7
|
: never;
|