@catladder/pipeline 1.109.2 โ†’ 1.110.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.
Files changed (28) hide show
  1. package/dist/build/node/buildJob.js +10 -7
  2. package/dist/build/node/testJob.js +8 -5
  3. package/dist/build/rails/test.js +7 -7
  4. package/dist/build/types.d.ts +5 -1
  5. package/dist/bundles/catladder-gitlab/index.js +1 -1
  6. package/dist/constants.js +1 -1
  7. package/dist/tsconfig.tsbuildinfo +1 -1
  8. package/examples/__snapshots__/cloud-run-memory-limit.ts.snap +4 -0
  9. package/examples/__snapshots__/cloud-run-no-cpu-throttling.ts.snap +4 -0
  10. package/examples/__snapshots__/cloud-run-non-public.ts.snap +4 -0
  11. package/examples/__snapshots__/cloud-run-with-sql-reuse-db.ts.snap +8 -0
  12. package/examples/__snapshots__/cloud-run-with-sql.ts.snap +8 -0
  13. package/examples/__snapshots__/custom-deploy.ts.snap +4 -0
  14. package/examples/__snapshots__/custom-envs.ts.snap +4 -0
  15. package/examples/__snapshots__/kubernetes-application-customization.ts.snap +4 -0
  16. package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.ts.snap +4 -0
  17. package/examples/__snapshots__/kubernetes-with-cloud-sql.ts.snap +4 -0
  18. package/examples/__snapshots__/kubernetes-with-jobs.ts.snap +8 -0
  19. package/examples/__snapshots__/kubernetes-with-mongodb.ts.snap +4 -0
  20. package/examples/__snapshots__/native-app.ts.snap +8 -0
  21. package/examples/__snapshots__/node-build-with-custom-image.ts.snap +1812 -0
  22. package/examples/__snapshots__/wait-for-other-deploy.ts.snap +8 -0
  23. package/examples/node-build-with-custom-image.ts +25 -0
  24. package/package.json +1 -1
  25. package/src/build/node/buildJob.ts +3 -0
  26. package/src/build/node/testJob.ts +5 -4
  27. package/src/build/rails/test.ts +6 -3
  28. package/src/build/types.ts +5 -1
@@ -22,6 +22,7 @@ exports[`matches snapshot 1`] = `
22
22
  "policy": "pull-push",
23
23
  },
24
24
  ],
25
+ "image": "path/to/docker/jobs-default:the-version",
25
26
  "interruptible": true,
26
27
  "needs": [],
27
28
  "retry": {
@@ -181,6 +182,7 @@ exports[`matches snapshot 1`] = `
181
182
  },
182
183
  "api ๐Ÿ›ก audit": {
183
184
  "allow_failure": true,
185
+ "image": "path/to/docker/jobs-default:the-version",
184
186
  "interruptible": true,
185
187
  "needs": [],
186
188
  "retry": {
@@ -308,6 +310,7 @@ exports[`matches snapshot 1`] = `
308
310
  "policy": "pull-push",
309
311
  },
310
312
  ],
313
+ "image": "path/to/docker/jobs-default:the-version",
311
314
  "interruptible": true,
312
315
  "needs": [],
313
316
  "retry": {
@@ -471,6 +474,7 @@ exports[`matches snapshot 1`] = `
471
474
  },
472
475
  "www ๐Ÿ›ก audit": {
473
476
  "allow_failure": true,
477
+ "image": "path/to/docker/jobs-default:the-version",
474
478
  "interruptible": true,
475
479
  "needs": [],
476
480
  "retry": {
@@ -670,6 +674,7 @@ exports[`matches snapshot 1`] = `
670
674
  "policy": "pull-push",
671
675
  },
672
676
  ],
677
+ "image": "path/to/docker/jobs-default:the-version",
673
678
  "interruptible": true,
674
679
  "needs": [],
675
680
  "retry": {
@@ -829,6 +834,7 @@ exports[`matches snapshot 1`] = `
829
834
  },
830
835
  "api ๐Ÿ›ก audit": {
831
836
  "allow_failure": true,
837
+ "image": "path/to/docker/jobs-default:the-version",
832
838
  "interruptible": true,
833
839
  "needs": [],
834
840
  "retry": {
@@ -956,6 +962,7 @@ exports[`matches snapshot 1`] = `
956
962
  "policy": "pull-push",
957
963
  },
958
964
  ],
965
+ "image": "path/to/docker/jobs-default:the-version",
959
966
  "interruptible": true,
960
967
  "needs": [],
961
968
  "retry": {
@@ -1119,6 +1126,7 @@ exports[`matches snapshot 1`] = `
1119
1126
  },
1120
1127
  "www ๐Ÿ›ก audit": {
1121
1128
  "allow_failure": true,
1129
+ "image": "path/to/docker/jobs-default:the-version",
1122
1130
  "interruptible": true,
1123
1131
  "needs": [],
1124
1132
  "retry": {
@@ -0,0 +1,25 @@
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
+ www: {
9
+ dir: "www",
10
+ build: {
11
+ type: "node",
12
+ jobImage: "my-custom-image",
13
+ },
14
+ deploy: {
15
+ type: "google-cloudrun",
16
+ projectId: "asdf",
17
+ region: "asia-east1",
18
+ },
19
+ },
20
+ },
21
+ };
22
+
23
+ it("matches snapshot", async () => {
24
+ expect(await createAllPipelines(config)).toMatchSnapshot();
25
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@catladder/pipeline",
3
- "version": "1.109.2",
3
+ "version": "1.110.1",
4
4
  "scripts": {
5
5
  "build:tsc": "yarn tsc",
6
6
  "build": "yarn build:compile && yarn build:inline-variables && yarn build:bundle",
@@ -9,6 +9,7 @@ import { getNextCache, getNodeCache, getYarnCache } from "./cache";
9
9
  import { NODE_RUNNER_BUILD_VARIABLES } from "./constants";
10
10
  import { getDockerAppCopyAndBuildScript, getYarnInstall } from "./yarn";
11
11
  import type { CatladderJob } from "../../types/jobs";
12
+ import { getRunnerImage } from "../../runner";
12
13
 
13
14
  export const createNodeBuildJobs = (context: Context): CatladderJob[] => {
14
15
  const buildConfig = context.componentConfig.build;
@@ -17,10 +18,12 @@ export const createNodeBuildJobs = (context: Context): CatladderJob[] => {
17
18
  throw new Error("deploy config is not node, node-static or storybook");
18
19
  }
19
20
 
21
+ const defaultImage = getRunnerImage("jobs-default");
20
22
  const yarnInstall = getYarnInstall(context);
21
23
  const appBuildJob: CatladderJob | null =
22
24
  buildConfig.buildCommand !== null
23
25
  ? createBuildJob(context, {
26
+ image: buildConfig.jobImage ?? defaultImage,
24
27
  variables: {
25
28
  ...NODE_RUNNER_BUILD_VARIABLES,
26
29
  },
@@ -13,7 +13,7 @@ export const createNodeTestJobs = (context: Context): CatladderJob[] => {
13
13
  }
14
14
 
15
15
  const buildConfig = context.componentConfig.build;
16
-
16
+ const defaultImage = getRunnerImage("jobs-default");
17
17
  const base: Omit<CatladderJob, "script" | "name"> = {
18
18
  variables: {
19
19
  APP_PATH: context.componentConfig.dir,
@@ -30,8 +30,8 @@ export const createNodeTestJobs = (context: Context): CatladderJob[] => {
30
30
  buildConfig.audit !== false
31
31
  ? {
32
32
  name: "๐Ÿ›ก audit",
33
-
34
33
  ...base,
34
+ image: buildConfig.audit?.jobImage ?? defaultImage,
35
35
  cache: undefined, // audit does not need yarn install and no cache
36
36
  script: [
37
37
  `cd ${context.componentConfig.dir}`,
@@ -49,8 +49,8 @@ export const createNodeTestJobs = (context: Context): CatladderJob[] => {
49
49
  buildConfig.lint !== false
50
50
  ? {
51
51
  name: "๐Ÿ‘ฎ lint",
52
-
53
52
  ...base,
53
+ image: buildConfig.lint?.jobImage ?? defaultImage,
54
54
  cache: getNodeCache(context),
55
55
  script: [
56
56
  `cd ${context.componentConfig.dir}`,
@@ -65,7 +65,8 @@ export const createNodeTestJobs = (context: Context): CatladderJob[] => {
65
65
  name: "๐Ÿงช test",
66
66
 
67
67
  ...base,
68
- image: getRunnerImage("jobs-testing-chrome"),
68
+ image:
69
+ buildConfig.test?.jobImage ?? getRunnerImage("jobs-testing-chrome"),
69
70
  cache: getNodeCache(context),
70
71
  script: [
71
72
  `cd ${context.componentConfig.dir}`,
@@ -39,7 +39,8 @@ export const createRailsTestJobs = (context: Context): CatladderJob[] => {
39
39
 
40
40
  ...base,
41
41
  cache: undefined, // audit does not need bundle install and no cache
42
- image: buildConfig.audit?.jobImage ?? defaultImage,
42
+ image:
43
+ buildConfig.audit?.jobImage ?? buildConfig.jobImage ?? defaultImage,
43
44
  script: [
44
45
  `cd ${context.componentConfig.dir}`,
45
46
  ...(ensureArray(buildConfig.audit?.command) ?? [
@@ -58,7 +59,8 @@ export const createRailsTestJobs = (context: Context): CatladderJob[] => {
58
59
 
59
60
  ...base,
60
61
  cache: bundlerCache,
61
- image: buildConfig.lint?.jobImage ?? defaultImage,
62
+ image:
63
+ buildConfig.lint?.jobImage ?? buildConfig.jobImage ?? defaultImage,
62
64
  script: [
63
65
  `cd ${context.componentConfig.dir}`,
64
66
  ...bundlerInstall,
@@ -75,7 +77,8 @@ export const createRailsTestJobs = (context: Context): CatladderJob[] => {
75
77
 
76
78
  ...base,
77
79
  cache: bundlerCache,
78
- image: buildConfig.test?.jobImage ?? defaultImage,
80
+ image:
81
+ buildConfig.test?.jobImage ?? buildConfig.jobImage ?? defaultImage,
79
82
  script: [
80
83
  `cd ${context.componentConfig.dir}`,
81
84
  ...bundlerInstall,
@@ -93,6 +93,10 @@ export type BuildConfigBase = {
93
93
  * tags for the underlying job runner (e.g gitlab)
94
94
  */
95
95
  jobTags?: string[];
96
+ /**
97
+ * custom image to use
98
+ */
99
+ jobImage?: GitlabJobImage;
96
100
  };
97
101
 
98
102
  export type BuildConfigNodeBase = BuildConfigBase & {
@@ -142,7 +146,7 @@ export type BuildConfigCustom = Omit<
142
146
  "lint" | "test" | "audit"
143
147
  > & {
144
148
  type: "custom";
145
- jobImage: string;
149
+ jobImage: GitlabJobImage;
146
150
  jobServices?: GitlabJobService[];
147
151
 
148
152
  docker: BuildConfigCustomDocker;