@catladder/pipeline 1.168.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.
Files changed (43) hide show
  1. package/dist/build/base/createAppBuildJob.d.ts +1 -2
  2. package/dist/build/base/createBuildJobDefinition.d.ts +3 -4
  3. package/dist/build/base/index.d.ts +1 -2
  4. package/dist/build/cache/createJobCache.d.ts +3 -2
  5. package/dist/build/cache/createJobCache.js +2 -2
  6. package/dist/build/cache/getAllCacheConfigsFromConfig.d.ts +2 -2
  7. package/dist/build/cache/getAllCacheConfigsFromConfig.js +2 -6
  8. package/dist/build/docker.d.ts +2 -3
  9. package/dist/build/node/buildJob.d.ts +1 -2
  10. package/dist/build/types.d.ts +6 -0
  11. package/dist/bundles/catladder-gitlab/index.js +1 -1
  12. package/dist/constants.js +1 -1
  13. package/dist/context/getEnvironmentVariables.d.ts +1 -1
  14. package/dist/deploy/base/deploy.d.ts +1 -1
  15. package/dist/deploy/base/deploy.js +2 -1
  16. package/dist/deploy/base/index.d.ts +1 -3
  17. package/dist/deploy/base/rollback.d.ts +1 -1
  18. package/dist/deploy/base/stop.d.ts +1 -1
  19. package/dist/deploy/custom/deployJob.js +6 -4
  20. package/dist/deploy/types/custom.d.ts +2 -6
  21. package/dist/tsconfig.tsbuildinfo +1 -1
  22. package/dist/types/config.d.ts +3 -3
  23. package/dist/types/jobDefinition.d.ts +8 -2
  24. package/examples/__snapshots__/custom-deploy.test.ts.snap +0 -4
  25. package/examples/__snapshots__/native-app.test.ts.snap +4 -0
  26. package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +0 -8
  27. package/examples/native-app.ts +6 -6
  28. package/package.json +1 -1
  29. package/src/build/base/createAppBuildJob.ts +1 -2
  30. package/src/build/base/createBuildJobDefinition.ts +3 -4
  31. package/src/build/base/index.ts +4 -2
  32. package/src/build/cache/createJobCache.ts +6 -9
  33. package/src/build/cache/getAllCacheConfigsFromConfig.ts +5 -12
  34. package/src/build/docker.ts +2 -3
  35. package/src/build/node/buildJob.ts +4 -2
  36. package/src/build/types.ts +7 -0
  37. package/src/deploy/base/deploy.ts +5 -11
  38. package/src/deploy/base/index.ts +8 -3
  39. package/src/deploy/base/rollback.ts +1 -4
  40. package/src/deploy/base/stop.ts +1 -4
  41. package/src/deploy/custom/deployJob.ts +5 -2
  42. package/src/deploy/types/custom.ts +3 -7
  43. package/src/types/jobDefinition.ts +27 -2
@@ -1,7 +1,6 @@
1
1
  import type { BuildContextStandalone, ComponentContext, WorkspaceContext } from "../..";
2
- import type { JobDefintion } from "../../types/jobDefinition";
2
+ import type { AppBuildJobDefinition } from "../../types/jobDefinition";
3
3
  import type { CatladderJob } from "../../types/jobs";
4
- export type AppBuildJobDefinition = JobDefintion;
5
4
  export declare const createAppBuildJob: (context: ComponentContext<BuildContextStandalone> | WorkspaceContext, {
6
5
  script,
7
6
  variables,
@@ -1,7 +1,6 @@
1
1
  import type { BuildConfigStandalone, WorkspaceBuildConfig } from "..";
2
- import type { Context } from "../../types";
3
- import type { JobDefintion } from "../../types/jobDefinition";
4
- export declare const createBuildJobDefinition: (context: Context, buildConfig: BuildConfigStandalone | WorkspaceBuildConfig, customize?: Pick<JobDefintion, "cache"> & {
2
+ import type { AppBuildJobDefinition, Context } from "../../types";
3
+ export declare const createBuildJobDefinition: (context: Context, buildConfig: BuildConfigStandalone | WorkspaceBuildConfig, customize?: Pick<AppBuildJobDefinition, "cache"> & {
5
4
  prescript?: string[];
6
5
  postscript?: string[];
7
- }) => JobDefintion | undefined;
6
+ }) => AppBuildJobDefinition | undefined;
@@ -1,8 +1,7 @@
1
1
  import type { WorkspaceContext } from "../../types/context";
2
2
  import { type ComponentContext } from "../../types/context";
3
+ import type { AppBuildJobDefinition, DockerBuildJobDefinition } from "../../types/jobDefinition";
3
4
  import type { CatladderJob } from "../../types/jobs";
4
- import type { DockerBuildJobDefinition } from "../docker";
5
- import type { AppBuildJobDefinition } from "./createAppBuildJob";
6
5
  export declare const createComponentBuildJobs: (context: ComponentContext, definitions: {
7
6
  appBuild?: AppBuildJobDefinition;
8
7
  dockerBuild: DockerBuildJobDefinition;
@@ -1,6 +1,7 @@
1
- import type { BuildConfigStandalone, CacheConfig, WorkspaceBuildConfig } from "..";
1
+ import type { CacheConfig } from "..";
2
2
  import type { Context } from "../../types";
3
3
  import type { CatladderJobCache } from "../../types/jobs";
4
+ import type { WithCacheConfig } from "../types";
4
5
  export declare const createJobCacheFromCacheConfigs: (context: Context, caches: CacheConfig[]) => CatladderJobCache[] | undefined;
5
6
  /** shortcut, used in some build types */
6
- export declare const createJobCacheFromConfig: (context: Context, buildConfig: BuildConfigStandalone | WorkspaceBuildConfig) => import("../../types").GitlabJobCache[] | undefined;
7
+ export declare const createJobCacheFromConfig: (context: Context, configWithCache: WithCacheConfig) => import("../../types").GitlabJobCache[] | undefined;
@@ -103,7 +103,7 @@ var createJobCacheFromCacheConfigs = function (context, caches) {
103
103
  };
104
104
  exports.createJobCacheFromCacheConfigs = createJobCacheFromCacheConfigs;
105
105
  /** shortcut, used in some build types */
106
- var createJobCacheFromConfig = function (context, buildConfig) {
107
- return (0, exports.createJobCacheFromCacheConfigs)(context, (0, getAllCacheConfigsFromConfig_1.getAllCacheConfigsFromConfig)(context, buildConfig));
106
+ var createJobCacheFromConfig = function (context, configWithCache) {
107
+ return (0, exports.createJobCacheFromCacheConfigs)(context, (0, getAllCacheConfigsFromConfig_1.getAllCacheConfigsFromConfig)(context, configWithCache));
108
108
  };
109
109
  exports.createJobCacheFromConfig = createJobCacheFromConfig;
@@ -1,3 +1,3 @@
1
1
  import type { Context } from "../../types";
2
- import type { BuildConfigStandalone, CacheConfig, WorkspaceBuildConfig } from "../types";
3
- export declare const getAllCacheConfigsFromConfig: (context: Context, buildConfig: BuildConfigStandalone | WorkspaceBuildConfig) => CacheConfig[];
2
+ import type { CacheConfig, WithCacheConfig } from "../types";
3
+ export declare const getAllCacheConfigsFromConfig: (context: Context, configWithCache: WithCacheConfig) => CacheConfig[];
@@ -47,12 +47,8 @@ Object.defineProperty(exports, "__esModule", {
47
47
  exports.getAllCacheConfigsFromConfig = void 0;
48
48
  var index_1 = require("../../utils/index");
49
49
  var transformLegacyJobCache_1 = require("./transformLegacyJobCache");
50
- var getAllCacheConfigsFromConfig = function (context, buildConfig) {
51
- return __spreadArray(__spreadArray(__spreadArray([], __read("jobCache" in buildConfig ? (0, transformLegacyJobCache_1.transformLegacyJobCache)(buildConfig.jobCache) : []), false), __read((0, index_1.ensureArray)(buildConfig.cache).map(function (c) {
52
- return __assign(__assign({}, c), {
53
- context: context
54
- });
55
- })), false), __read(context.type === "workspace" ?
50
+ var getAllCacheConfigsFromConfig = function (context, configWithCache) {
51
+ return __spreadArray(__spreadArray(__spreadArray([], __read("jobCache" in configWithCache ? (0, transformLegacyJobCache_1.transformLegacyJobCache)(configWithCache.jobCache) : []), false), __read((0, index_1.ensureArray)(configWithCache.cache)), false), __read(context.type === "workspace" ?
56
52
  // also add cache configs of the components of that workspace
57
53
  context.components.flatMap(function (componentContext) {
58
54
  var _a;
@@ -1,5 +1,5 @@
1
1
  import type { BuildConfigDocker } from ".";
2
- import type { ComponentContext, JobDefintion } from "../types";
2
+ import type { ComponentContext, DockerBuildJobDefinition } from "../types";
3
3
  import type { CatladderJob } from "../types/jobs";
4
4
  export declare const getDockerImageVariables: (context: ComponentContext) => {
5
5
  DOCKER_IMAGE_TAG: string;
@@ -58,12 +58,11 @@ export declare const getDockerBuildVariables: (context: ComponentContext) => {
58
58
  };
59
59
  export declare const DOCKER_BUILD_JOB_NAME = "\uD83D\uDD28 docker";
60
60
  export declare const getDockerJobBaseProps: () => Pick<CatladderJob, "image" | "services" | "variables" | "runnerVariables">;
61
- export type DockerBuildJobDefinition = JobDefintion;
62
61
  export declare const createDockerBuildJobBase: (context: ComponentContext, {
63
62
  script,
64
63
  cache,
65
64
  ...def
66
- }: JobDefintion) => CatladderJob;
65
+ }: DockerBuildJobDefinition) => CatladderJob;
67
66
  export declare const gitlabDockerLogin: (context: ComponentContext) => string[];
68
67
  export declare const getDockerBuildScriptWithBuiltInDockerFile: (context: ComponentContext, defaultType?: BuildConfigDocker["type"]) => (string | undefined)[];
69
68
  export declare const getDockerBuildDefaultScript: (context: ComponentContext, ensureDockerFileScript?: string | null) => (string | undefined)[];
@@ -1,8 +1,7 @@
1
1
  import type { BuildContextStandalone, WorkspaceContext } from "../../types/context";
2
2
  import { type ComponentContext } from "../../types/context";
3
+ import type { AppBuildJobDefinition, DockerBuildJobDefinition } from "../../types/jobDefinition";
3
4
  import type { CatladderJob } from "../../types/jobs";
4
- import type { AppBuildJobDefinition } from "../base/createAppBuildJob";
5
- import type { DockerBuildJobDefinition } from "../docker";
6
5
  export declare const createNodeBuildJobs: (context: ComponentContext | WorkspaceContext) => CatladderJob[];
7
6
  export declare const createNodeBuildJobDefinition: (context: ComponentContext<BuildContextStandalone> | WorkspaceContext) => AppBuildJobDefinition | undefined;
8
7
  export declare const createNodeDockerJobDefinition: (context: ComponentContext) => DockerBuildJobDefinition;
@@ -41,6 +41,12 @@ export type BuildConfigArtifactsReports = {
41
41
  };
42
42
  export type WithCacheConfig = {
43
43
  cache?: CacheConfig | CacheConfig[];
44
+ /**
45
+ * customize cache for the job
46
+ *
47
+ * @deprecated use cache
48
+ */
49
+ jobCache?: CatladderJob["cache"];
44
50
  };
45
51
  export type TestJobCustom = {
46
52
  command?: string | string[];