@catladder/pipeline 1.167.0 → 1.168.1
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/createAppBuildJob.d.ts +1 -2
- package/dist/build/base/createBuildJobDefinition.d.ts +3 -4
- package/dist/build/base/index.d.ts +1 -2
- package/dist/build/cache/createJobCache.d.ts +3 -2
- package/dist/build/cache/createJobCache.js +2 -2
- package/dist/build/cache/getAllCacheConfigsFromConfig.d.ts +2 -2
- package/dist/build/cache/getAllCacheConfigsFromConfig.js +2 -6
- package/dist/build/docker.d.ts +2 -3
- package/dist/build/node/buildJob.d.ts +1 -2
- package/dist/build/types.d.ts +6 -0
- package/dist/bundles/catladder-gitlab/index.js +2 -2
- package/dist/constants.js +1 -1
- package/dist/context/getEnvironmentVariables.d.ts +1 -1
- package/dist/deploy/base/deploy.d.ts +1 -1
- package/dist/deploy/base/deploy.js +2 -1
- package/dist/deploy/base/index.d.ts +1 -3
- package/dist/deploy/base/rollback.d.ts +1 -1
- package/dist/deploy/base/stop.d.ts +1 -1
- package/dist/deploy/cloudRun/createJobs/cloudRunJobs.js +76 -50
- package/dist/deploy/custom/deployJob.js +6 -4
- package/dist/deploy/types/custom.d.ts +2 -6
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +3 -3
- package/dist/types/jobDefinition.d.ts +8 -2
- package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +84 -32
- package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +10 -4
- package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +40 -16
- package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +112 -48
- package/examples/__snapshots__/custom-deploy.test.ts.snap +0 -4
- package/examples/__snapshots__/native-app.test.ts.snap +4 -0
- package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +0 -8
- package/examples/native-app.ts +6 -6
- package/package.json +1 -1
- package/src/build/base/createAppBuildJob.ts +1 -2
- package/src/build/base/createBuildJobDefinition.ts +3 -4
- package/src/build/base/index.ts +4 -2
- package/src/build/cache/createJobCache.ts +6 -9
- package/src/build/cache/getAllCacheConfigsFromConfig.ts +5 -12
- package/src/build/docker.ts +2 -3
- package/src/build/node/buildJob.ts +4 -2
- package/src/build/types.ts +7 -0
- package/src/deploy/base/deploy.ts +5 -11
- package/src/deploy/base/index.ts +8 -3
- package/src/deploy/base/rollback.ts +1 -4
- package/src/deploy/base/stop.ts +1 -4
- package/src/deploy/cloudRun/createJobs/cloudRunJobs.ts +109 -74
- package/src/deploy/custom/deployJob.ts +5 -2
- package/src/deploy/types/custom.ts +3 -7
- package/src/types/jobDefinition.ts +27 -2
|
@@ -328,7 +328,6 @@ www 🧪 test:
|
|
|
328
328
|
- echo 'Uploading SBOM to Dependency Track'
|
|
329
329
|
- /dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/www" "https://unknown-host.example.com" "__sbom.json" vex.json || true
|
|
330
330
|
- echo "CL_GITLAB_ENVIRONMENT_URL=https://unknown-host.example.com" >> gitlab_environment.env
|
|
331
|
-
cache: []
|
|
332
331
|
environment:
|
|
333
332
|
name: dev/www
|
|
334
333
|
url: $CL_GITLAB_ENVIRONMENT_URL
|
|
@@ -561,7 +560,6 @@ www 🧪 test:
|
|
|
561
560
|
- echo 'Uploading SBOM to Dependency Track'
|
|
562
561
|
- /dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/www" "https://unknown-host.example.com" "__sbom.json" vex.json || true
|
|
563
562
|
- echo "CL_GITLAB_ENVIRONMENT_URL=https://unknown-host.example.com" >> gitlab_environment.env
|
|
564
|
-
cache: []
|
|
565
563
|
environment:
|
|
566
564
|
name: review/$CI_COMMIT_REF_NAME/www
|
|
567
565
|
url: $CL_GITLAB_ENVIRONMENT_URL
|
|
@@ -790,7 +788,6 @@ www 🧪 test:
|
|
|
790
788
|
- echo 'Uploading SBOM to Dependency Track'
|
|
791
789
|
- /dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/www" "https://unknown-host.example.com" "__sbom.json" vex.json || true
|
|
792
790
|
- echo "CL_GITLAB_ENVIRONMENT_URL=https://unknown-host.example.com" >> gitlab_environment.env
|
|
793
|
-
cache: []
|
|
794
791
|
environment:
|
|
795
792
|
name: stage/www
|
|
796
793
|
url: $CL_GITLAB_ENVIRONMENT_URL
|
|
@@ -1012,7 +1009,6 @@ www 🧪 test:
|
|
|
1012
1009
|
- echo 'Uploading SBOM to Dependency Track'
|
|
1013
1010
|
- /dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/www" "https://unknown-host.example.com" "__sbom.json" vex.json || true
|
|
1014
1011
|
- echo "CL_GITLAB_ENVIRONMENT_URL=https://unknown-host.example.com" >> gitlab_environment.env
|
|
1015
|
-
cache: []
|
|
1016
1012
|
environment:
|
|
1017
1013
|
name: prod/www
|
|
1018
1014
|
url: $CL_GITLAB_ENVIRONMENT_URL
|
|
@@ -321,6 +321,7 @@ app 🧪 test:
|
|
|
321
321
|
- key:
|
|
322
322
|
files:
|
|
323
323
|
- app/Gemfile.lock
|
|
324
|
+
policy: pull-push
|
|
324
325
|
paths:
|
|
325
326
|
- app/vendor
|
|
326
327
|
rules:
|
|
@@ -500,6 +501,7 @@ app 🧪 test:
|
|
|
500
501
|
- key:
|
|
501
502
|
files:
|
|
502
503
|
- app/Gemfile.lock
|
|
504
|
+
policy: pull-push
|
|
503
505
|
paths:
|
|
504
506
|
- app/vendor
|
|
505
507
|
rules:
|
|
@@ -677,6 +679,7 @@ app 🧪 test:
|
|
|
677
679
|
- key:
|
|
678
680
|
files:
|
|
679
681
|
- app/Gemfile.lock
|
|
682
|
+
policy: pull-push
|
|
680
683
|
paths:
|
|
681
684
|
- app/vendor
|
|
682
685
|
rules:
|
|
@@ -848,6 +851,7 @@ app 🧪 test:
|
|
|
848
851
|
- key:
|
|
849
852
|
files:
|
|
850
853
|
- app/Gemfile.lock
|
|
854
|
+
policy: pull-push
|
|
851
855
|
paths:
|
|
852
856
|
- app/vendor
|
|
853
857
|
rules:
|
|
@@ -262,7 +262,6 @@ api 🧪 test:
|
|
|
262
262
|
- yarn deploy
|
|
263
263
|
- echo 'Uploading SBOM to Dependency Track'
|
|
264
264
|
- /dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/api" "https://unknown-host.example.com" "__sbom.json" vex.json || true
|
|
265
|
-
cache: []
|
|
266
265
|
rules:
|
|
267
266
|
- when: never
|
|
268
267
|
if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
|
|
@@ -387,7 +386,6 @@ api 🧪 test:
|
|
|
387
386
|
- yarn deploy
|
|
388
387
|
- echo 'Uploading SBOM to Dependency Track'
|
|
389
388
|
- /dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/api" "https://unknown-host.example.com" "__sbom.json" vex.json || true
|
|
390
|
-
cache: []
|
|
391
389
|
rules:
|
|
392
390
|
- when: on_success
|
|
393
391
|
if: $CI_MERGE_REQUEST_ID
|
|
@@ -510,7 +508,6 @@ api 🧪 test:
|
|
|
510
508
|
- yarn deploy
|
|
511
509
|
- echo 'Uploading SBOM to Dependency Track'
|
|
512
510
|
- /dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/api" "https://unknown-host.example.com" "__sbom.json" vex.json || true
|
|
513
|
-
cache: []
|
|
514
511
|
rules:
|
|
515
512
|
- when: on_success
|
|
516
513
|
if: $CI_COMMIT_TAG
|
|
@@ -627,7 +624,6 @@ api 🧪 test:
|
|
|
627
624
|
- yarn deploy
|
|
628
625
|
- echo 'Uploading SBOM to Dependency Track'
|
|
629
626
|
- /dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/api" "https://unknown-host.example.com" "__sbom.json" vex.json || true
|
|
630
|
-
cache: []
|
|
631
627
|
rules:
|
|
632
628
|
- when: manual
|
|
633
629
|
if: $CI_COMMIT_TAG
|
|
@@ -852,7 +848,6 @@ www 🧪 test:
|
|
|
852
848
|
- yarn deploy
|
|
853
849
|
- echo 'Uploading SBOM to Dependency Track'
|
|
854
850
|
- /dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/www" "https://unknown-host.example.com" "__sbom.json" vex.json || true
|
|
855
|
-
cache: []
|
|
856
851
|
rules:
|
|
857
852
|
- when: never
|
|
858
853
|
if: $CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/
|
|
@@ -979,7 +974,6 @@ www 🧪 test:
|
|
|
979
974
|
- yarn deploy
|
|
980
975
|
- echo 'Uploading SBOM to Dependency Track'
|
|
981
976
|
- /dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/www" "https://unknown-host.example.com" "__sbom.json" vex.json || true
|
|
982
|
-
cache: []
|
|
983
977
|
rules:
|
|
984
978
|
- when: on_success
|
|
985
979
|
if: $CI_MERGE_REQUEST_ID
|
|
@@ -1104,7 +1098,6 @@ www 🧪 test:
|
|
|
1104
1098
|
- yarn deploy
|
|
1105
1099
|
- echo 'Uploading SBOM to Dependency Track'
|
|
1106
1100
|
- /dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/www" "https://unknown-host.example.com" "__sbom.json" vex.json || true
|
|
1107
|
-
cache: []
|
|
1108
1101
|
rules:
|
|
1109
1102
|
- when: on_success
|
|
1110
1103
|
if: $CI_COMMIT_TAG
|
|
@@ -1223,7 +1216,6 @@ www 🧪 test:
|
|
|
1223
1216
|
- yarn deploy
|
|
1224
1217
|
- echo 'Uploading SBOM to Dependency Track'
|
|
1225
1218
|
- /dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/www" "https://unknown-host.example.com" "__sbom.json" vex.json || true
|
|
1226
|
-
cache: []
|
|
1227
1219
|
rules:
|
|
1228
1220
|
- when: manual
|
|
1229
1221
|
if: $CI_COMMIT_TAG
|
package/examples/native-app.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Config } from "../src";
|
|
1
|
+
import type { CacheConfig, Config } from "../src";
|
|
2
2
|
import type { CatladderJob } from "../src/types/jobs";
|
|
3
3
|
|
|
4
|
-
const APP_GEM_CACHE:
|
|
4
|
+
const APP_GEM_CACHE: CacheConfig[] = [
|
|
5
5
|
{
|
|
6
6
|
key: {
|
|
7
|
-
files: ["
|
|
7
|
+
files: ["Gemfile.lock"],
|
|
8
8
|
},
|
|
9
|
-
paths: ["
|
|
9
|
+
paths: ["vendor"],
|
|
10
10
|
},
|
|
11
11
|
];
|
|
12
12
|
|
|
@@ -41,7 +41,7 @@ const config: Config = {
|
|
|
41
41
|
"bundle exec fastlane build",
|
|
42
42
|
],
|
|
43
43
|
jobTags: ["mac-runner"],
|
|
44
|
-
|
|
44
|
+
cache: APP_GEM_CACHE,
|
|
45
45
|
},
|
|
46
46
|
|
|
47
47
|
deploy: {
|
|
@@ -58,7 +58,7 @@ const config: Config = {
|
|
|
58
58
|
"bundle exec fastlane deploy_test",
|
|
59
59
|
],
|
|
60
60
|
jobTags: ["mac-runner"],
|
|
61
|
-
|
|
61
|
+
cache: APP_GEM_CACHE,
|
|
62
62
|
},
|
|
63
63
|
},
|
|
64
64
|
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
WorkspaceContext,
|
|
6
6
|
} from "../..";
|
|
7
7
|
import { getRunnerImage } from "../..";
|
|
8
|
-
import type {
|
|
8
|
+
import type { AppBuildJobDefinition } from "../../types/jobDefinition";
|
|
9
9
|
import type { CatladderJob } from "../../types/jobs";
|
|
10
10
|
import { ensureArray } from "../../utils";
|
|
11
11
|
import { createBuildJobArtifacts } from "../artifacts/createBuildJobArtifact";
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
writeDotEnv,
|
|
22
22
|
} from "./writeDotEnv";
|
|
23
23
|
|
|
24
|
-
export type AppBuildJobDefinition = JobDefintion;
|
|
25
24
|
export const createAppBuildJob = (
|
|
26
25
|
context: ComponentContext<BuildContextStandalone> | WorkspaceContext,
|
|
27
26
|
{ script, variables, runnerVariables, cache, ...def }: AppBuildJobDefinition,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { BuildConfigStandalone, WorkspaceBuildConfig } from "..";
|
|
2
2
|
import { getRunnerImage } from "../../runner";
|
|
3
|
-
import type { Context } from "../../types";
|
|
4
|
-
import type { JobDefintion } from "../../types/jobDefinition";
|
|
3
|
+
import type { AppBuildJobDefinition, Context } from "../../types";
|
|
5
4
|
import { ensureArray } from "../../utils";
|
|
6
5
|
import { getAllCacheConfigsFromConfig } from "../cache/getAllCacheConfigsFromConfig";
|
|
7
6
|
import { NODE_RUNNER_BUILD_VARIABLES } from "../node/constants";
|
|
@@ -9,11 +8,11 @@ import { NODE_RUNNER_BUILD_VARIABLES } from "../node/constants";
|
|
|
9
8
|
export const createBuildJobDefinition = (
|
|
10
9
|
context: Context,
|
|
11
10
|
buildConfig: BuildConfigStandalone | WorkspaceBuildConfig,
|
|
12
|
-
customize: Pick<
|
|
11
|
+
customize: Pick<AppBuildJobDefinition, "cache"> & {
|
|
13
12
|
prescript?: string[];
|
|
14
13
|
postscript?: string[];
|
|
15
14
|
} = {},
|
|
16
|
-
):
|
|
15
|
+
): AppBuildJobDefinition | undefined => {
|
|
17
16
|
if (buildConfig.buildCommand === null) return undefined;
|
|
18
17
|
|
|
19
18
|
const defaultImage = getRunnerImage("jobs-default");
|
package/src/build/base/index.ts
CHANGED
|
@@ -5,12 +5,14 @@ import {
|
|
|
5
5
|
componentContextIsStandaloneBuild,
|
|
6
6
|
type ComponentContext,
|
|
7
7
|
} from "../../types/context";
|
|
8
|
+
import type {
|
|
9
|
+
AppBuildJobDefinition,
|
|
10
|
+
DockerBuildJobDefinition,
|
|
11
|
+
} from "../../types/jobDefinition";
|
|
8
12
|
import type { CatladderJob } from "../../types/jobs";
|
|
9
|
-
import type { DockerBuildJobDefinition } from "../docker";
|
|
10
13
|
import { createDockerBuildJobBase, requiresDockerBuild } from "../docker";
|
|
11
14
|
import { createSbomBuildJob } from "../sbom";
|
|
12
15
|
import { APP_BUILD_JOB_NAME } from "./constants";
|
|
13
|
-
import type { AppBuildJobDefinition } from "./createAppBuildJob";
|
|
14
16
|
import { createAppBuildJob } from "./createAppBuildJob";
|
|
15
17
|
|
|
16
18
|
export const createComponentBuildJobs = (
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { join } from "path";
|
|
2
|
-
import type {
|
|
3
|
-
BuildConfigStandalone,
|
|
4
|
-
CacheConfig,
|
|
5
|
-
CacheConfigAdvanced,
|
|
6
|
-
CacheConfigSimple,
|
|
7
|
-
WorkspaceBuildConfig,
|
|
8
|
-
} from "..";
|
|
2
|
+
import type { CacheConfig, CacheConfigAdvanced, CacheConfigSimple } from "..";
|
|
9
3
|
import type { Context } from "../../types";
|
|
10
4
|
import type { CatladderJobCache } from "../../types/jobs";
|
|
5
|
+
import type { WithCacheConfig } from "../types";
|
|
11
6
|
import { getAllCacheConfigsFromConfig } from "./getAllCacheConfigsFromConfig";
|
|
12
7
|
|
|
13
8
|
export const createJobCacheFromCacheConfigs = (
|
|
@@ -61,6 +56,7 @@ export const createJobCacheFromCacheConfigs = (
|
|
|
61
56
|
pathMode === "absolute" ? f : join(baseDir, f),
|
|
62
57
|
),
|
|
63
58
|
};
|
|
59
|
+
|
|
64
60
|
return {
|
|
65
61
|
key: transformedKey,
|
|
66
62
|
policy: policy ?? "pull-push",
|
|
@@ -70,16 +66,17 @@ export const createJobCacheFromCacheConfigs = (
|
|
|
70
66
|
};
|
|
71
67
|
},
|
|
72
68
|
);
|
|
69
|
+
|
|
73
70
|
return [...advancedCaches, ...simpleCaches];
|
|
74
71
|
};
|
|
75
72
|
|
|
76
73
|
/** shortcut, used in some build types */
|
|
77
74
|
export const createJobCacheFromConfig = (
|
|
78
75
|
context: Context,
|
|
79
|
-
|
|
76
|
+
configWithCache: WithCacheConfig,
|
|
80
77
|
) => {
|
|
81
78
|
return createJobCacheFromCacheConfigs(
|
|
82
79
|
context,
|
|
83
|
-
getAllCacheConfigsFromConfig(context,
|
|
80
|
+
getAllCacheConfigsFromConfig(context, configWithCache),
|
|
84
81
|
);
|
|
85
82
|
};
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import type { Context } from "../../types";
|
|
2
2
|
import { ensureArray } from "../../utils/index";
|
|
3
|
-
import type {
|
|
4
|
-
BuildConfigStandalone,
|
|
5
|
-
CacheConfig,
|
|
6
|
-
WorkspaceBuildConfig,
|
|
7
|
-
} from "../types";
|
|
3
|
+
import type { CacheConfig, WithCacheConfig } from "../types";
|
|
8
4
|
import { transformLegacyJobCache } from "./transformLegacyJobCache";
|
|
9
5
|
|
|
10
6
|
export const getAllCacheConfigsFromConfig = (
|
|
11
7
|
context: Context,
|
|
12
|
-
|
|
8
|
+
configWithCache: WithCacheConfig,
|
|
13
9
|
): CacheConfig[] => {
|
|
14
10
|
return [
|
|
15
|
-
...("jobCache" in
|
|
16
|
-
? transformLegacyJobCache(
|
|
11
|
+
...("jobCache" in configWithCache
|
|
12
|
+
? transformLegacyJobCache(configWithCache.jobCache)
|
|
17
13
|
: []),
|
|
18
|
-
...ensureArray(
|
|
19
|
-
...c,
|
|
20
|
-
context,
|
|
21
|
-
})),
|
|
14
|
+
...ensureArray(configWithCache.cache),
|
|
22
15
|
...(context.type === "workspace"
|
|
23
16
|
? // also add cache configs of the components of that workspace
|
|
24
17
|
context.components.flatMap<CacheConfig>(
|
package/src/build/docker.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "../deploy/cloudRun/artifactsRegistry";
|
|
11
11
|
import { gcloudServiceAccountLoginCommands } from "../deploy/cloudRun/utils/gcloudServiceAccountLoginCommands";
|
|
12
12
|
import { getRunnerImage } from "../runner";
|
|
13
|
-
import type { ComponentContext,
|
|
13
|
+
import type { ComponentContext, DockerBuildJobDefinition } from "../types";
|
|
14
14
|
import type { CatladderJob } from "../types/jobs";
|
|
15
15
|
import { collapseableSection } from "../utils/gitlab";
|
|
16
16
|
import { createJobCacheFromCacheConfigs } from "./cache/createJobCache";
|
|
@@ -119,10 +119,9 @@ export const getDockerJobBaseProps = (): Pick<
|
|
|
119
119
|
};
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
-
export type DockerBuildJobDefinition = JobDefintion;
|
|
123
122
|
export const createDockerBuildJobBase = (
|
|
124
123
|
context: ComponentContext,
|
|
125
|
-
{ script, cache, ...def }:
|
|
124
|
+
{ script, cache, ...def }: DockerBuildJobDefinition,
|
|
126
125
|
): CatladderJob => {
|
|
127
126
|
return merge(
|
|
128
127
|
{
|
|
@@ -6,11 +6,13 @@ import {
|
|
|
6
6
|
componentContextIsStandaloneBuild,
|
|
7
7
|
type ComponentContext,
|
|
8
8
|
} from "../../types/context";
|
|
9
|
+
import type {
|
|
10
|
+
AppBuildJobDefinition,
|
|
11
|
+
DockerBuildJobDefinition,
|
|
12
|
+
} from "../../types/jobDefinition";
|
|
9
13
|
import type { CatladderJob } from "../../types/jobs";
|
|
10
14
|
import { createComponentBuildJobs, createWorkspaceBuildJobs } from "../base";
|
|
11
|
-
import type { AppBuildJobDefinition } from "../base/createAppBuildJob";
|
|
12
15
|
import { createBuildJobDefinition } from "../base/createBuildJobDefinition";
|
|
13
|
-
import type { DockerBuildJobDefinition } from "../docker";
|
|
14
16
|
import { getDockerBuildScriptWithBuiltInDockerFile } from "../docker";
|
|
15
17
|
import type { BuildConfigDocker } from "../types";
|
|
16
18
|
import { getNextCache, getNodeCache, getYarnCache } from "./cache";
|
package/src/build/types.ts
CHANGED
|
@@ -53,6 +53,13 @@ export type WithCacheConfig = {
|
|
|
53
53
|
cache config. All Paths are relative to the context dir.
|
|
54
54
|
*/
|
|
55
55
|
cache?: CacheConfig | CacheConfig[];
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* customize cache for the job
|
|
59
|
+
*
|
|
60
|
+
* @deprecated use cache
|
|
61
|
+
*/
|
|
62
|
+
jobCache?: CatladderJob["cache"];
|
|
56
63
|
};
|
|
57
64
|
|
|
58
65
|
export type TestJobCustom = {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { createJobCacheFromCacheConfigs } from "../../build/cache/createJobCache";
|
|
1
2
|
import {
|
|
2
3
|
getDockerImageVariables,
|
|
3
4
|
requiresDockerBuild,
|
|
4
5
|
} from "../../build/docker";
|
|
5
6
|
import { SBOM_BUILD_JOB_NAME } from "../../build/sbom";
|
|
7
|
+
import type { DeployJobDefinition } from "../../types";
|
|
6
8
|
import {
|
|
7
9
|
componentContextHasWorkspaceBuild,
|
|
8
10
|
type ComponentContext,
|
|
@@ -16,16 +18,6 @@ import { DEPLOY_RUNNER_VARIABLES } from "./variables";
|
|
|
16
18
|
|
|
17
19
|
export const DEPLOY_JOB_NAME = "🚀 Deploy";
|
|
18
20
|
|
|
19
|
-
export type DeployJobDefinition = Pick<
|
|
20
|
-
CatladderJob,
|
|
21
|
-
| "script"
|
|
22
|
-
| "variables"
|
|
23
|
-
| "image"
|
|
24
|
-
| "cache"
|
|
25
|
-
| "artifacts"
|
|
26
|
-
| "services"
|
|
27
|
-
| "runnerVariables"
|
|
28
|
-
>;
|
|
29
21
|
export const createDeployJob = (
|
|
30
22
|
context: ComponentContext,
|
|
31
23
|
jobDefinition: DeployJobDefinition,
|
|
@@ -58,7 +50,9 @@ export const createDeployJob = (
|
|
|
58
50
|
name: DEPLOY_JOB_NAME,
|
|
59
51
|
script: jobDefinition.script,
|
|
60
52
|
image: jobDefinition.image,
|
|
61
|
-
cache: jobDefinition.cache
|
|
53
|
+
cache: jobDefinition.cache
|
|
54
|
+
? createJobCacheFromCacheConfigs(context, jobDefinition.cache)
|
|
55
|
+
: undefined,
|
|
62
56
|
artifacts: jobDefinition.artifacts,
|
|
63
57
|
services: jobDefinition.services,
|
|
64
58
|
envMode: "stagePerEnv", // makes it easier to run manual tasks er env
|
package/src/deploy/base/index.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { ComponentContext } from "../../types/context";
|
|
2
|
+
import type {
|
|
3
|
+
DeployJobDefinition,
|
|
4
|
+
RollbackJobDefinition,
|
|
5
|
+
StopJobDefinition,
|
|
6
|
+
} from "../../types/jobDefinition";
|
|
2
7
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
|
-
import { createDeployJob
|
|
4
|
-
import { createRollbackJob
|
|
5
|
-
import { createStopJob
|
|
8
|
+
import { createDeployJob } from "./deploy";
|
|
9
|
+
import { createRollbackJob } from "./rollback";
|
|
10
|
+
import { createStopJob } from "./stop";
|
|
6
11
|
|
|
7
12
|
export const createDeployementJobs = (
|
|
8
13
|
context: ComponentContext,
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import type { ComponentContext } from "../../types/context";
|
|
2
|
+
import type { RollbackJobDefinition } from "../../types/jobDefinition";
|
|
2
3
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
4
|
import { DEPLOY_RUNNER_VARIABLES } from "./variables";
|
|
4
5
|
|
|
5
6
|
export const ROLLBACK_JOB_NAME = "↩️ Rollback ⚠️";
|
|
6
7
|
|
|
7
|
-
export type RollbackJobDefinition = Pick<
|
|
8
|
-
CatladderJob,
|
|
9
|
-
"script" | "variables" | "runnerVariables" | "image"
|
|
10
|
-
>;
|
|
11
8
|
export const createRollbackJob = (
|
|
12
9
|
context: ComponentContext,
|
|
13
10
|
jobDefinition: RollbackJobDefinition,
|
package/src/deploy/base/stop.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import type { ComponentContext } from "../../types/context";
|
|
2
|
+
import type { StopJobDefinition } from "../../types/jobDefinition";
|
|
2
3
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
4
|
|
|
4
5
|
import { DEPLOY_RUNNER_VARIABLES } from "./variables";
|
|
5
6
|
export const STOP_JOB_NAME = "🛑 Stop ⚠️";
|
|
6
7
|
|
|
7
|
-
export type StopJobDefinition = Pick<
|
|
8
|
-
CatladderJob,
|
|
9
|
-
"script" | "variables" | "image" | "runnerVariables"
|
|
10
|
-
>;
|
|
11
8
|
export const createStopJob = (
|
|
12
9
|
context: ComponentContext,
|
|
13
10
|
jobDefinition: StopJobDefinition,
|