@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.
- package/dist/build/base/createAppBuildJob.d.ts +1 -2
- package/dist/build/base/createBuildJobDefinition.d.ts +3 -4
- package/dist/build/base/index.d.ts +1 -2
- package/dist/build/cache/createJobCache.d.ts +3 -2
- package/dist/build/cache/createJobCache.js +2 -2
- package/dist/build/cache/getAllCacheConfigsFromConfig.d.ts +2 -2
- package/dist/build/cache/getAllCacheConfigsFromConfig.js +2 -6
- package/dist/build/docker.d.ts +2 -3
- package/dist/build/node/buildJob.d.ts +1 -2
- package/dist/build/types.d.ts +6 -0
- package/dist/bundles/catladder-gitlab/index.js +1 -1
- package/dist/constants.js +1 -1
- package/dist/context/getEnvironmentVariables.d.ts +1 -1
- package/dist/deploy/base/deploy.d.ts +1 -1
- package/dist/deploy/base/deploy.js +2 -1
- package/dist/deploy/base/index.d.ts +1 -3
- package/dist/deploy/base/rollback.d.ts +1 -1
- package/dist/deploy/base/stop.d.ts +1 -1
- package/dist/deploy/custom/deployJob.js +6 -4
- package/dist/deploy/types/custom.d.ts +2 -6
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +3 -3
- package/dist/types/jobDefinition.d.ts +8 -2
- package/examples/__snapshots__/custom-deploy.test.ts.snap +0 -4
- package/examples/__snapshots__/native-app.test.ts.snap +4 -0
- package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +0 -8
- package/examples/native-app.ts +6 -6
- package/package.json +1 -1
- package/src/build/base/createAppBuildJob.ts +1 -2
- package/src/build/base/createBuildJobDefinition.ts +3 -4
- package/src/build/base/index.ts +4 -2
- package/src/build/cache/createJobCache.ts +6 -9
- package/src/build/cache/getAllCacheConfigsFromConfig.ts +5 -12
- package/src/build/docker.ts +2 -3
- package/src/build/node/buildJob.ts +4 -2
- package/src/build/types.ts +7 -0
- package/src/deploy/base/deploy.ts +5 -11
- package/src/deploy/base/index.ts +8 -3
- package/src/deploy/base/rollback.ts +1 -4
- package/src/deploy/base/stop.ts +1 -4
- package/src/deploy/custom/deployJob.ts +5 -2
- package/src/deploy/types/custom.ts +3 -7
- package/src/types/jobDefinition.ts +27 -2
package/dist/constants.js
CHANGED
|
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
7
|
-
exports.PIPELINE_IMAGE_TAG = "v1-168-
|
|
7
|
+
exports.PIPELINE_IMAGE_TAG = "v1-168-1-1cf21d4c" || "latest";
|
|
8
8
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || "git.panter.ch:5001/catladder/catladder";
|
|
@@ -9,7 +9,7 @@ export type SecretEnvVar = {
|
|
|
9
9
|
declare const getBasePredefinedVariables: (ctx: EnvironmentContext) => {
|
|
10
10
|
ENV_SHORT: string;
|
|
11
11
|
APP_DIR: string;
|
|
12
|
-
ENV_TYPE: "
|
|
12
|
+
ENV_TYPE: "stage" | "dev" | "review" | "prod" | "local";
|
|
13
13
|
};
|
|
14
14
|
type BasePredefinedVariables = ReturnType<typeof getBasePredefinedVariables>;
|
|
15
15
|
export type PredefinedVariables = BasePredefinedVariables & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { DeployJobDefinition } from "../../types";
|
|
1
2
|
import { type ComponentContext } from "../../types/context";
|
|
2
3
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
4
|
export declare const DEPLOY_JOB_NAME = "\uD83D\uDE80 Deploy";
|
|
4
|
-
export type DeployJobDefinition = Pick<CatladderJob, "script" | "variables" | "image" | "cache" | "artifacts" | "services" | "runnerVariables">;
|
|
5
5
|
export declare const createDeployJob: (context: ComponentContext, jobDefinition: DeployJobDefinition) => CatladderJob;
|
|
@@ -45,6 +45,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
45
45
|
value: true
|
|
46
46
|
});
|
|
47
47
|
exports.createDeployJob = exports.DEPLOY_JOB_NAME = void 0;
|
|
48
|
+
var createJobCache_1 = require("../../build/cache/createJobCache");
|
|
48
49
|
var docker_1 = require("../../build/docker");
|
|
49
50
|
var sbom_1 = require("../../build/sbom");
|
|
50
51
|
var context_1 = require("../../types/context");
|
|
@@ -70,7 +71,7 @@ var createDeployJob = function (context, jobDefinition) {
|
|
|
70
71
|
name: exports.DEPLOY_JOB_NAME,
|
|
71
72
|
script: jobDefinition.script,
|
|
72
73
|
image: jobDefinition.image,
|
|
73
|
-
cache: jobDefinition.cache,
|
|
74
|
+
cache: jobDefinition.cache ? (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, jobDefinition.cache) : undefined,
|
|
74
75
|
artifacts: jobDefinition.artifacts,
|
|
75
76
|
services: jobDefinition.services,
|
|
76
77
|
envMode: "stagePerEnv",
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { ComponentContext } from "../../types/context";
|
|
2
|
+
import type { DeployJobDefinition, RollbackJobDefinition, StopJobDefinition } from "../../types/jobDefinition";
|
|
2
3
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
|
-
import { type DeployJobDefinition } from "./deploy";
|
|
4
|
-
import { type RollbackJobDefinition } from "./rollback";
|
|
5
|
-
import { type StopJobDefinition } from "./stop";
|
|
6
4
|
export declare const createDeployementJobs: (context: ComponentContext, definitions: {
|
|
7
5
|
deploy: DeployJobDefinition;
|
|
8
6
|
stop?: StopJobDefinition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentContext } from "../../types/context";
|
|
2
|
+
import type { RollbackJobDefinition } from "../../types/jobDefinition";
|
|
2
3
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
4
|
export declare const ROLLBACK_JOB_NAME = "\u21A9\uFE0F Rollback \u26A0\uFE0F";
|
|
4
|
-
export type RollbackJobDefinition = Pick<CatladderJob, "script" | "variables" | "runnerVariables" | "image">;
|
|
5
5
|
export declare const createRollbackJob: (context: ComponentContext, jobDefinition: RollbackJobDefinition) => CatladderJob;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentContext } from "../../types/context";
|
|
2
|
+
import type { StopJobDefinition } from "../../types/jobDefinition";
|
|
2
3
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
4
|
export declare const STOP_JOB_NAME = "\uD83D\uDED1 Stop \u26A0\uFE0F";
|
|
4
|
-
export type StopJobDefinition = Pick<CatladderJob, "script" | "variables" | "image" | "runnerVariables">;
|
|
5
5
|
export declare const createStopJob: (context: ComponentContext, jobDefinition: StopJobDefinition) => CatladderJob;
|
|
@@ -35,13 +35,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
35
35
|
value: true
|
|
36
36
|
});
|
|
37
37
|
exports.createCustomDeployJobs = void 0;
|
|
38
|
+
var getAllCacheConfigsFromConfig_1 = require("../../build/cache/getAllCacheConfigsFromConfig");
|
|
38
39
|
var yarn_1 = require("../../build/node/yarn");
|
|
39
40
|
var runner_1 = require("../../runner");
|
|
40
41
|
var base_1 = require("../base");
|
|
41
42
|
var sbom_1 = require("../sbom");
|
|
42
43
|
var types_1 = require("../types");
|
|
43
44
|
var createCustomDeployJobs = function (context) {
|
|
44
|
-
var _a, _b, _c
|
|
45
|
+
var _a, _b, _c;
|
|
45
46
|
var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
|
|
46
47
|
if (!(0, types_1.isOfDeployType)(deployConfig, "custom")) {
|
|
47
48
|
// should not happen
|
|
@@ -51,18 +52,19 @@ var createCustomDeployJobs = function (context) {
|
|
|
51
52
|
var yarnInstall = (0, yarn_1.getYarnInstall)(context, {
|
|
52
53
|
noCustomPostInstall: true
|
|
53
54
|
});
|
|
54
|
-
|
|
55
|
+
var result = (0, base_1.createDeployementJobs)(context, {
|
|
55
56
|
deploy: {
|
|
56
57
|
image: (_b = deployConfig.jobImage) !== null && _b !== void 0 ? _b : (0, runner_1.getRunnerImage)("jobs-default"),
|
|
57
|
-
cache: (
|
|
58
|
+
cache: (0, getAllCacheConfigsFromConfig_1.getAllCacheConfigsFromConfig)(context, deployConfig),
|
|
58
59
|
script: __spreadArray(__spreadArray(__spreadArray(["cd ".concat(context.build.dir)], __read(deployConfig.requiresYarnInstall ? yarnInstall : []), false), __read(deployConfig.script), false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false),
|
|
59
60
|
variables: {}
|
|
60
61
|
},
|
|
61
62
|
stop: deployConfig.stopScript ? {
|
|
62
|
-
image: (
|
|
63
|
+
image: (_c = deployConfig.jobImage) !== null && _c !== void 0 ? _c : (0, runner_1.getRunnerImage)("jobs-default"),
|
|
63
64
|
script: __spreadArray(__spreadArray([], __read(deployConfig.stopScript), false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false),
|
|
64
65
|
variables: {}
|
|
65
66
|
} : undefined
|
|
66
67
|
});
|
|
68
|
+
return result;
|
|
67
69
|
};
|
|
68
70
|
exports.createCustomDeployJobs = createCustomDeployJobs;
|
|
@@ -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;
|