@catladder/pipeline 1.111.0 → 1.111.2

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.
@@ -0,0 +1,65 @@
1
+ import type { Config } from "../src";
2
+ import { createAllPipelines } from "./__utils__/helpers";
3
+
4
+ const config: Config = {
5
+ customerName: "pan",
6
+ appName: "my-app",
7
+ components: {
8
+ web: {
9
+ dir: "app",
10
+
11
+ build: { type: "meteor" },
12
+ deploy: {
13
+ type: "kubernetes",
14
+ values: {
15
+ mongodb: {
16
+ enabled: true,
17
+ architecture: "standalone",
18
+ },
19
+ application: {
20
+ worker: { enabled: true },
21
+ },
22
+ },
23
+ cluster: {
24
+ name: "some-cluster-name",
25
+ region: "europe-west6",
26
+ projectId: "some-project-id",
27
+ type: "gcloud",
28
+ domainCanonical: "panter.cloud",
29
+ },
30
+ },
31
+ env: {
32
+ prod: {
33
+ host: "www.example.com",
34
+
35
+ deploy: {
36
+ values: {
37
+ application: {
38
+ redirects: [{ host: "example.com" }],
39
+ },
40
+ mongodb: {
41
+ enabled: true,
42
+ architecture: "replicaset",
43
+ replicaCount: 2,
44
+ persistence: {
45
+ storageClass: "premium-rwo", // SSD
46
+ size: "50Gi",
47
+ },
48
+ resources: {
49
+ limits: { memory: "8Gi" },
50
+ requests: { memory: "8Gi" },
51
+ },
52
+ },
53
+ },
54
+ },
55
+ },
56
+ },
57
+ },
58
+ },
59
+ };
60
+
61
+ export default config;
62
+
63
+ it("matches snapshot", async () => {
64
+ expect(await createAllPipelines(config)).toMatchSnapshot();
65
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@catladder/pipeline",
3
- "version": "1.111.0",
3
+ "version": "1.111.2",
4
4
  "scripts": {
5
5
  "build:tsc": "yarn tsc",
6
6
  "build": "yarn build:compile && yarn build:inline-variables && yarn build:bundle",
@@ -24,26 +24,14 @@ export const getDockerImageVariables = (context: Context) => {
24
24
  };
25
25
  };
26
26
 
27
- export const requiresDockerBuild = (context: Context) => {
28
- const deployConfig = context.componentConfig.deploy;
29
- if (isOfDeployType(deployConfig, "kubernetes")) {
30
- return true;
31
- }
32
-
33
- if (isOfDeployType(deployConfig, "google-cloudrun")) {
34
- return true;
35
- }
36
-
37
- if (isOfDeployType(deployConfig, "custom") && deployConfig.requiresDocker) {
38
- return true;
39
- }
40
-
41
- if (isOfDeployType(deployConfig, "dockerTag")) {
42
- return true;
43
- }
44
-
45
- return false;
46
- };
27
+ /**
28
+ * Weather the context requires a docker build
29
+ */
30
+ export const requiresDockerBuild = ({
31
+ componentConfig: { deploy },
32
+ }: Context): boolean =>
33
+ isOfDeployType(deploy, "kubernetes", "google-cloudrun", "dockerTag") ||
34
+ (isOfDeployType(deploy, "custom") && deploy.requiresDocker);
47
35
 
48
36
  const getDockerBaseVariables = () => ({
49
37
  DOCKER_HOST: "tcp://0.0.0.0:2375",
@@ -11,6 +11,8 @@ import { createDockerBuildJobDefault } from "../docker";
11
11
  import { isOfBuildType } from "../types";
12
12
  import { getNodeCache } from "./cache";
13
13
  import { getYarnInstall } from "./yarn";
14
+ import { sbomDeactivated } from "../../deploy/sbom";
15
+ import { createSbomBuildJob } from "../sbom";
14
16
 
15
17
  const getMeteorCache = (context: Context): GitlabJobCache[] => [
16
18
  {
@@ -71,5 +73,6 @@ export const createMeteorBuildJobs = (context: Context): CatladderJob[] => {
71
73
  },
72
74
  needs: appBuildJob ? [APP_BUILD_JOB_NAME] : [],
73
75
  }),
76
+ ...(sbomDeactivated(context) ? [] : [createSbomBuildJob(context)]),
74
77
  ];
75
78
  };