@catladder/pipeline 1.150.1 → 1.150.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.
@@ -32,13 +32,13 @@ export const createMeteorBuildJobs = (
32
32
  throw new Error("deploy config is not meteor");
33
33
  }
34
34
 
35
- const yarnInstall = getYarnInstall(context.build);
35
+ const yarnInstall = getYarnInstall(context);
36
36
 
37
37
  return createBuildJobs(context, {
38
38
  appBuild:
39
39
  buildConfig.buildCommand !== null
40
40
  ? {
41
- cache: [...getNodeCache(context.build), ...getMeteorCache(context)],
41
+ cache: [...getNodeCache(context), ...getMeteorCache(context)],
42
42
  image: getRunnerImage("jobs-meteor"),
43
43
  variables: {
44
44
  METEOR_DISABLE_OPTIMISTIC_CACHING: "1", // see https://forums.meteor.com/t/veeery-long-building-time-inside-docker-container/58673/17?u=macrozone
@@ -30,7 +30,7 @@ export const createNodeTestJobs = (
30
30
  needs: [],
31
31
  envMode: "none",
32
32
  };
33
- const yarnInstall = getYarnInstall(context.build);
33
+ const yarnInstall = getYarnInstall(context);
34
34
  const auditJob: CatladderJob | null =
35
35
  buildConfig.audit !== false
36
36
  ? {
@@ -41,7 +41,7 @@ export const createNodeTestJobs = (
41
41
  script: [
42
42
  `cd ${context.build.dir}`,
43
43
  ...(ensureArray(buildConfig.audit?.command) ?? [
44
- context.build.packageManagerInfo.isClassic
44
+ context.packageManagerInfo.isClassic
45
45
  ? "yarn audit"
46
46
  : "yarn npm audit --environment production", // yarn 2
47
47
  ]),
@@ -61,9 +61,9 @@ export const createNodeTestJobs = (
61
61
  name: "👮 lint",
62
62
  ...base,
63
63
  image: buildConfig.lint?.jobImage ?? defaultImage,
64
- cache: getNodeCache(context.build),
64
+ cache: getNodeCache(context),
65
65
  script: [
66
- ...ensureNodeVersion(context.build),
66
+ ...ensureNodeVersion(context),
67
67
  `cd ${context.build.dir}`,
68
68
  ...yarnInstall,
69
69
  ...(ensureArray(buildConfig.lint?.command) ?? ["yarn lint"]),
@@ -83,9 +83,9 @@ export const createNodeTestJobs = (
83
83
  ...base,
84
84
  image:
85
85
  buildConfig.test?.jobImage ?? getRunnerImage("jobs-testing-chrome"),
86
- cache: getNodeCache(context.build),
86
+ cache: getNodeCache(context),
87
87
  script: [
88
- ...ensureNodeVersion(context.build),
88
+ ...ensureNodeVersion(context),
89
89
  `cd ${context.build.dir}`,
90
90
  ...yarnInstall,
91
91
  ...(ensureArray(buildConfig.test?.command) ?? ["yarn test"]),
@@ -1,5 +1,5 @@
1
1
  import { BashExpression } from "../../bash/BashExpression";
2
- import type { BuildContext, ComponentContext } from "../../types";
2
+ import type { BuildContext, ComponentContext, Context } from "../../types";
3
3
  import { ensureArray } from "../../utils";
4
4
  import { collapseableSection } from "../../utils/gitlab";
5
5
 
@@ -8,7 +8,7 @@ const YARN_INSTALL_CLASSIC = `yarn install --frozen-lockfile`;
8
8
  // FIXME: check why and when rebuild is needed
9
9
  const YARN_BERRY_PROD_REBUILD = `yarn workspaces focus --production && yarn rebuild`;
10
10
 
11
- const getYarnInstallCommand = (context: BuildContext) => {
11
+ const getYarnInstallCommand = (context: Context) => {
12
12
  if (context.packageManagerInfo.isClassic) {
13
13
  return YARN_INSTALL_CLASSIC;
14
14
  }
@@ -16,7 +16,7 @@ const getYarnInstallCommand = (context: BuildContext) => {
16
16
  return `yarn install --immutable`;
17
17
  };
18
18
 
19
- export const ensureNodeVersion = (context: BuildContext) =>
19
+ export const ensureNodeVersion = (context: Context) =>
20
20
  collapseableSection(
21
21
  "nodeinstall",
22
22
  "Ensure node version",
@@ -26,13 +26,15 @@ export const ensureNodeVersion = (context: BuildContext) =>
26
26
  ]);
27
27
 
28
28
  export const getYarnInstall = (
29
- context: BuildContext,
29
+ context: Context,
30
30
  options?: {
31
31
  noCustomPostInstall: boolean;
32
32
  },
33
33
  ) => {
34
34
  const postInstall =
35
- "postInstall" in context.config ? context.config.postInstall : null;
35
+ "postInstall" in context.build.config
36
+ ? context.build.config.postInstall
37
+ : null;
36
38
  return [
37
39
  ...ensureNodeVersion(context),
38
40
  ...collapseableSection(
@@ -50,7 +52,7 @@ export const getYarnInstall = (
50
52
 
51
53
  const DOCKER_COPY_FILES = `COPY --chown=node:node $APP_DIR .`;
52
54
 
53
- export const getDockerAppCopyAndBuildScript = (context: BuildContext) => {
55
+ export const getDockerAppCopyAndBuildScript = (context: Context) => {
54
56
  if (context.packageManagerInfo.isClassic) {
55
57
  return new BashExpression(
56
58
  `
package/src/build/sbom.ts CHANGED
@@ -11,7 +11,7 @@ export const createSbomBuildJob = (context: ComponentContext): CatladderJob => {
11
11
  const defaultImage = "aquasec/trivy:0.38.3";
12
12
  const defaultScript = [
13
13
  `trivy fs --quiet --format cyclonedx --output "${SBOM_FILE}" ${
14
- context.build.packageManagerInfo.componentIsInWorkspace
14
+ context.packageManagerInfo.componentIsInWorkspace
15
15
  ? "."
16
16
  : context.build.dir
17
17
  }`,
@@ -67,7 +67,6 @@ export const createComponentContext = async (
67
67
 
68
68
  build: {
69
69
  dir: dir,
70
- packageManagerInfo: packageManagerInfo,
71
70
  config: build,
72
71
  },
73
72
  deploy: deploy
@@ -19,7 +19,7 @@ export const createCustomDeployJobs = (
19
19
  throw new Error("deploy config is not custom");
20
20
  }
21
21
  // FIXME: custom deploy currently assumes yarn-based project
22
- const yarnInstall = getYarnInstall(context.build, {
22
+ const yarnInstall = getYarnInstall(context, {
23
23
  noCustomPostInstall: true,
24
24
  });
25
25
  return createDeployementJobs(context, {
@@ -87,7 +87,7 @@ export type ContextBeforeConfig = {
87
87
 
88
88
  export type BuildContextComponent = {
89
89
  dir: string;
90
- packageManagerInfo: PackageManagerInfoComponent;
90
+
91
91
  config: BuildConfig;
92
92
  };
93
93
 
@@ -112,17 +112,12 @@ export type ComponentContext = {
112
112
 
113
113
  trigger?: PipelineTrigger;
114
114
  pipelineType?: PipelineType;
115
- /**
116
- * @deprecated use buildContext.packageManagerInfo instead
117
- */
115
+
118
116
  packageManagerInfo: PackageManagerInfoComponent;
119
117
 
120
118
  customJobs?: CatladderJob[];
121
119
  };
122
120
 
123
- /**
124
- * @deprecated use ComponentContext instead
125
- */
126
121
  export type Context = ComponentContext;
127
122
 
128
123
  export type CatladderJobWithContext<S = BaseStage> = CatladderJob<S> & {