@catladder/cli 0.0.0-main-2f2f483e → 0.0.0-main-b38c122b

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 (38) hide show
  1. package/dist/bundles/catenv/index.js +24 -22
  2. package/dist/bundles/cli/index.js +16 -14
  3. package/dist/pipeline/src/build/base/createAppBuildJob.d.ts +1 -2
  4. package/dist/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
  5. package/dist/pipeline/src/build/base/createBuildJobDefinition.d.ts +3 -4
  6. package/dist/pipeline/src/build/base/createBuildJobDefinition.js.map +1 -1
  7. package/dist/pipeline/src/build/base/index.d.ts +1 -2
  8. package/dist/pipeline/src/build/base/index.js.map +1 -1
  9. package/dist/pipeline/src/build/cache/createJobCache.d.ts +3 -2
  10. package/dist/pipeline/src/build/cache/createJobCache.js +2 -2
  11. package/dist/pipeline/src/build/cache/createJobCache.js.map +1 -1
  12. package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.d.ts +2 -2
  13. package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.js +4 -7
  14. package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.js.map +1 -1
  15. package/dist/pipeline/src/build/docker.d.ts +2 -3
  16. package/dist/pipeline/src/build/docker.js.map +1 -1
  17. package/dist/pipeline/src/build/node/buildJob.d.ts +1 -2
  18. package/dist/pipeline/src/build/node/buildJob.js.map +1 -1
  19. package/dist/pipeline/src/build/types.d.ts +6 -0
  20. package/dist/pipeline/src/build/types.js.map +1 -1
  21. package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +1 -1
  22. package/dist/pipeline/src/deploy/base/deploy.d.ts +1 -1
  23. package/dist/pipeline/src/deploy/base/deploy.js +4 -1
  24. package/dist/pipeline/src/deploy/base/deploy.js.map +1 -1
  25. package/dist/pipeline/src/deploy/base/index.d.ts +1 -3
  26. package/dist/pipeline/src/deploy/base/index.js.map +1 -1
  27. package/dist/pipeline/src/deploy/base/rollback.d.ts +1 -1
  28. package/dist/pipeline/src/deploy/base/rollback.js.map +1 -1
  29. package/dist/pipeline/src/deploy/base/stop.d.ts +1 -1
  30. package/dist/pipeline/src/deploy/base/stop.js.map +1 -1
  31. package/dist/pipeline/src/deploy/custom/deployJob.js +6 -4
  32. package/dist/pipeline/src/deploy/custom/deployJob.js.map +1 -1
  33. package/dist/pipeline/src/deploy/types/custom.d.ts +2 -6
  34. package/dist/pipeline/src/deploy/types/index.d.ts +3 -3
  35. package/dist/pipeline/src/types/config.d.ts +3 -3
  36. package/dist/pipeline/src/types/jobDefinition.d.ts +7 -1
  37. package/dist/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +1 -1
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createCustomDeployJobs = void 0;
4
+ const getAllCacheConfigsFromConfig_1 = require("../../build/cache/getAllCacheConfigsFromConfig");
4
5
  const yarn_1 = require("../../build/node/yarn");
5
6
  const runner_1 = require("../../runner");
6
7
  const base_1 = require("../base");
7
8
  const sbom_1 = require("../sbom");
8
9
  const types_1 = require("../types");
9
10
  const createCustomDeployJobs = (context) => {
10
- var _a, _b, _c, _d;
11
+ var _a, _b, _c;
11
12
  const deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
12
13
  if (!(0, types_1.isOfDeployType)(deployConfig, "custom")) {
13
14
  // should not happen
@@ -17,10 +18,10 @@ const createCustomDeployJobs = (context) => {
17
18
  const yarnInstall = (0, yarn_1.getYarnInstall)(context, {
18
19
  noCustomPostInstall: true,
19
20
  });
20
- return (0, base_1.createDeployementJobs)(context, {
21
+ const result = (0, base_1.createDeployementJobs)(context, {
21
22
  deploy: {
22
23
  image: (_b = deployConfig.jobImage) !== null && _b !== void 0 ? _b : (0, runner_1.getRunnerImage)("jobs-default"),
23
- cache: (_c = deployConfig.jobCache) !== null && _c !== void 0 ? _c : [],
24
+ cache: (0, getAllCacheConfigsFromConfig_1.getAllCacheConfigsFromConfig)(context, deployConfig),
24
25
  script: [
25
26
  `cd ${context.build.dir}`,
26
27
  ...(deployConfig.requiresYarnInstall ? yarnInstall : []),
@@ -31,7 +32,7 @@ const createCustomDeployJobs = (context) => {
31
32
  },
32
33
  stop: deployConfig.stopScript
33
34
  ? {
34
- image: (_d = deployConfig.jobImage) !== null && _d !== void 0 ? _d : (0, runner_1.getRunnerImage)("jobs-default"),
35
+ image: (_c = deployConfig.jobImage) !== null && _c !== void 0 ? _c : (0, runner_1.getRunnerImage)("jobs-default"),
35
36
  script: [
36
37
  ...deployConfig.stopScript,
37
38
  ...(0, sbom_1.getDependencyTrackDeleteScript)(context),
@@ -40,6 +41,7 @@ const createCustomDeployJobs = (context) => {
40
41
  }
41
42
  : undefined,
42
43
  });
44
+ return result;
43
45
  };
44
46
  exports.createCustomDeployJobs = createCustomDeployJobs;
45
47
  //# sourceMappingURL=deployJob.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"deployJob.js","sourceRoot":"","sources":["../../../../../../pipeline/src/deploy/custom/deployJob.ts"],"names":[],"mappings":";;;AAAA,gDAAuD;AACvD,yCAA8C;AAG9C,kCAAgD;AAChD,kCAGiB;AACjB,oCAA0C;AAEnC,MAAM,sBAAsB,GAAG,CACpC,OAAyB,EACT,EAAE;;IAClB,MAAM,YAAY,GAAG,MAAA,OAAO,CAAC,MAAM,0CAAE,MAAM,CAAC;IAE5C,IAAI,CAAC,IAAA,sBAAc,EAAC,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC5C,oBAAoB;QACpB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IACD,4DAA4D;IAC5D,MAAM,WAAW,GAAG,IAAA,qBAAc,EAAC,OAAO,EAAE;QAC1C,mBAAmB,EAAE,IAAI;KAC1B,CAAC,CAAC;IACH,OAAO,IAAA,4BAAqB,EAAC,OAAO,EAAE;QACpC,MAAM,EAAE;YACN,KAAK,EAAE,MA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WAAW,GAAG,IAAA,qBAAc,EAAC,OAAO,EAAE;QAC1C,mBAAmB,EAAE,IAAI;KAC1B,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAA,4BAAqB,EAAC,OAAO,EAAE;QAC5C,MAAM,EAAE;YACN,KAAK,EAAE,MAAA,YAAY,CAAC,QAAQ,mCAAI,IAAA,uBAAc,EAAC,cAAc,CAAC;YAC9D,KAAK,EAAE,IAAA,2DAA4B,EAAC,OAAO,EAAE,YAAY,CAAC;YAC1D,MAAM,EAAE;gBACN,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE;gBACzB,GAAG,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;gBACxD,GAAG,YAAY,CAAC,MAAM;gBACtB,GAAG,IAAA,qCAA8B,EAAC,OAAO,CAAC;aAC3C;YACD,SAAS,EAAE,EAAE;SACd;QACD,IAAI,EAAE,YAAY,CAAC,UAAU;YAC3B,CAAC,CAAC;gBACE,KAAK,EAAE,MAAA,YAAY,CAAC,QAAQ,mCAAI,IAAA,uBAAc,EAAC,cAAc,CAAC;gBAC9D,MAAM,EAAE;oBACN,GAAG,YAAY,CAAC,UAAU;oBAC1B,GAAG,IAAA,qCAA8B,EAAC,OAAO,CAAC;iBAC3C;gBACD,SAAS,EAAE,EAAE;aACd;YACH,CAAC,CAAC,SAAS;KACd,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAtCW,QAAA,sBAAsB,0BAsCjC"}
@@ -1,5 +1,5 @@
1
+ import type { WithCacheConfig } from "../../build";
1
2
  import type { GitlabJobImage } from "../../types";
2
- import type { CatladderJob } from "../../types/jobs";
3
3
  import type { DeployConfigBase } from "./base";
4
4
  export type DeployConfigCustom = {
5
5
  /**
@@ -26,8 +26,4 @@ export type DeployConfigCustom = {
26
26
  * image to use
27
27
  */
28
28
  jobImage?: GitlabJobImage;
29
- /**
30
- * customize cache for the job
31
- */
32
- jobCache?: CatladderJob["cache"];
33
- } & DeployConfigBase;
29
+ } & DeployConfigBase & WithCacheConfig;
@@ -11,12 +11,12 @@ export type DeployConfigType = DeployConfig["type"];
11
11
  export type DeployConfigGeneric<T extends DeployConfigType> = Extract<DeployConfig, {
12
12
  type: T;
13
13
  }>;
14
- export declare const isOfDeployType: <T extends ("custom" | "kubernetes" | "dockerTag" | "google-cloudrun")[]>(t: DeployConfig | false | null | undefined, ...types: T) => t is Extract<DeployConfigCustom, {
14
+ export declare const isOfDeployType: <T extends ("custom" | "kubernetes" | "google-cloudrun" | "dockerTag")[]>(t: DeployConfig | false | null | undefined, ...types: T) => t is Extract<DeployConfigKubernetes, {
15
15
  type: T[number];
16
- }> | Extract<DeployConfigDockerTag, {
16
+ }> | Extract<DeployConfigCustom, {
17
17
  type: T[number];
18
18
  }> | Extract<DeployConfigCloudRun, {
19
19
  type: T[number];
20
- }> | Extract<DeployConfigKubernetes, {
20
+ }> | Extract<DeployConfigDockerTag, {
21
21
  type: T[number];
22
22
  }>;
@@ -32,11 +32,11 @@ export declare const ENV_TYPES: {
32
32
  * @param trigger a trigger
33
33
  * @returns array of env types for that trigger. this is also the list of default envs
34
34
  */
35
- export declare const getEnvTypesByTrigger: (trigger: PipelineTrigger) => ("stage" | "dev" | "review" | "prod" | "local")[];
35
+ export declare const getEnvTypesByTrigger: (trigger: PipelineTrigger) => ("stage" | "local" | "dev" | "review" | "prod")[];
36
36
  export declare const DEFAULT_ENVS: string[];
37
- export declare const DEFAULT_ENV_TYPES: ("stage" | "dev" | "review" | "prod" | "local")[];
37
+ export declare const DEFAULT_ENV_TYPES: ("stage" | "local" | "dev" | "review" | "prod")[];
38
38
  export type EnvType = keyof typeof ENV_TYPES;
39
- export declare const isKnowEnvType: (env: string) => env is "stage" | "dev" | "review" | "prod" | "local";
39
+ export declare const isKnowEnvType: (env: string) => env is "stage" | "local" | "dev" | "review" | "prod";
40
40
  export type EnvVars = {
41
41
  /**
42
42
  * public env vars (means: they are checked in the repo).
@@ -1,5 +1,11 @@
1
1
  import type { CacheConfig } from "../build";
2
2
  import type { CatladderJob } from "./jobs";
3
- export type JobDefintion = Partial<Omit<CatladderJob, "artifacts" | "cache">> & {
3
+ export type AppBuildJobDefinition = Partial<Omit<CatladderJob, "artifacts" | "cache">> & {
4
4
  cache?: CacheConfig[];
5
5
  };
6
+ export type DockerBuildJobDefinition = AppBuildJobDefinition;
7
+ export type DeployJobDefinition = Pick<CatladderJob, "script" | "variables" | "image" | "artifacts" | "services" | "runnerVariables"> & {
8
+ cache?: CacheConfig[];
9
+ };
10
+ export type StopJobDefinition = Pick<CatladderJob, "script" | "variables" | "image" | "runnerVariables">;
11
+ export type RollbackJobDefinition = Pick<CatladderJob, "script" | "variables" | "runnerVariables" | "image">;