@catladder/cli 1.162.0 → 1.163.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/CONTRIBUTING.md +3 -86
- package/README.md +6 -29
- package/dist/bundles/catenv/index.js +1 -1
- package/dist/bundles/cli/index.js +1 -1
- package/dist/pipeline/src/build/types.d.ts +6 -0
- package/dist/pipeline/src/build/types.js.map +1 -1
- package/dist/pipeline/src/pipeline/generatePipelineFiles.d.ts +38 -0
- package/dist/pipeline/src/pipeline/generatePipelineFiles.js +41 -19
- package/dist/pipeline/src/pipeline/generatePipelineFiles.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -3
|
@@ -98,6 +98,9 @@ export type BuildConfigNode = {
|
|
|
98
98
|
docker?: Omit<BuildConfigDockerBuiltInNode, "type"> | BuildConfigDocker;
|
|
99
99
|
} & BuildConfigNodeBase;
|
|
100
100
|
export type BuildConfigNodeStatic = BuildConfigNodeBase & {
|
|
101
|
+
/**
|
|
102
|
+
* @deprecated use type: "node" and docker: { type: "nginx" } instead
|
|
103
|
+
*/
|
|
101
104
|
type: "node-static";
|
|
102
105
|
startCommand?: never;
|
|
103
106
|
docker?: Omit<BuildConfigDockerBuiltInNgninx, "type"> | BuildConfigDocker;
|
|
@@ -221,6 +224,9 @@ export type BuildConfigRails = BuildConfigBase & {
|
|
|
221
224
|
};
|
|
222
225
|
};
|
|
223
226
|
export type BuildConfigStorybook = BuildConfigNodeBase & {
|
|
227
|
+
/**
|
|
228
|
+
* @deprecated use type: "node" and docker: { type: "nginx" } instead
|
|
229
|
+
*/
|
|
224
230
|
type: "storybook";
|
|
225
231
|
startCommand?: never;
|
|
226
232
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../pipeline/src/build/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../pipeline/src/build/types.ts"],"names":[],"mappings":";;;AAsTO,IAAM,uBAAuB,GAAG,UACrC,CAAsB;IAEtB,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACrB,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;AACxB,CAAC,CAAC;AALW,QAAA,uBAAuB,2BAKlC;AAEK,IAAM,aAAa,GAAG,UAC3B,CAAc;IACd,eAAW;SAAX,UAAW,EAAX,qBAAW,EAAX,IAAW;QAAX,8BAAW;;IAEX,IAAI,CAAC,IAAA,+BAAuB,EAAC,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9C,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC,CAAC;AANW,QAAA,aAAa,iBAMxB"}
|
|
@@ -1,2 +1,40 @@
|
|
|
1
1
|
import type { Config, PipelineMode, PipelineType } from "../types";
|
|
2
|
+
export declare function generateChildPipelineContent<T extends PipelineType>(config: Config, pipelineType: T): Promise<{
|
|
3
|
+
image: string;
|
|
4
|
+
stages: string[];
|
|
5
|
+
variables: import("../types/gitlab-ci-yml").JobVariables1;
|
|
6
|
+
workflow: {
|
|
7
|
+
rules: {
|
|
8
|
+
if?: string;
|
|
9
|
+
changes?: import("../types/gitlab-ci-yml").Changes;
|
|
10
|
+
exists?: import("../types/gitlab-ci-yml").Exists;
|
|
11
|
+
variables?: import("../types/gitlab-ci-yml").RulesVariables;
|
|
12
|
+
when?: import("../types/gitlab-ci-yml").When;
|
|
13
|
+
start_in?: string;
|
|
14
|
+
allow_failure?: import("../types/gitlab-ci-yml").AllowFailure;
|
|
15
|
+
needs?: import("../types/gitlab-ci-yml").RulesNeeds;
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
} & Omit<import("../types").Pipeline<T>, "image" | "jobs" | "variables" | "workflow" | "stages"> & {
|
|
19
|
+
[k: string]: import("../types").GitlabJobDef;
|
|
20
|
+
}>;
|
|
21
|
+
export declare function generateLocalPipelineContent<T extends PipelineType>(config: Config, pipelineType: T): Promise<{
|
|
22
|
+
image: string;
|
|
23
|
+
stages: string[];
|
|
24
|
+
variables: import("../types/gitlab-ci-yml").JobVariables1;
|
|
25
|
+
workflow: {
|
|
26
|
+
rules: {
|
|
27
|
+
if?: string;
|
|
28
|
+
changes?: import("../types/gitlab-ci-yml").Changes;
|
|
29
|
+
exists?: import("../types/gitlab-ci-yml").Exists;
|
|
30
|
+
variables?: import("../types/gitlab-ci-yml").RulesVariables;
|
|
31
|
+
when?: import("../types/gitlab-ci-yml").When;
|
|
32
|
+
start_in?: string;
|
|
33
|
+
allow_failure?: import("../types/gitlab-ci-yml").AllowFailure;
|
|
34
|
+
needs?: import("../types/gitlab-ci-yml").RulesNeeds;
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
37
|
+
} & Omit<import("../types").Pipeline<T>, "image" | "jobs" | "variables" | "workflow" | "stages"> & {
|
|
38
|
+
[k: string]: import("../types").GitlabJobDef;
|
|
39
|
+
}>;
|
|
2
40
|
export declare function generatePipelineFiles<T extends PipelineType>(config: Config, pipelineType: T, mode: PipelineMode<T>): Promise<void>;
|
|
@@ -74,23 +74,22 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
74
74
|
return ar;
|
|
75
75
|
};
|
|
76
76
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
77
|
-
exports.generatePipelineFiles = void 0;
|
|
77
|
+
exports.generatePipelineFiles = exports.generateLocalPipelineContent = exports.generateChildPipelineContent = void 0;
|
|
78
78
|
var writeFiles_1 = require("../utils/writeFiles");
|
|
79
79
|
var createChildPipeline_1 = require("./createChildPipeline");
|
|
80
80
|
var createMainPipeline_1 = require("./createMainPipeline");
|
|
81
81
|
var getPipelineTriggerForGitlabChildPipeline_1 = require("./gitlab/getPipelineTriggerForGitlabChildPipeline");
|
|
82
82
|
var sortGitLabJobDefProps_1 = require("./gitlab/sortGitLabJobDefProps");
|
|
83
|
-
function
|
|
83
|
+
function generateChildPipelineContent(config, pipelineType) {
|
|
84
84
|
return __awaiter(this, void 0, void 0, function () {
|
|
85
|
-
var trigger, _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps
|
|
86
|
-
return __generator(this, function (
|
|
87
|
-
switch (
|
|
85
|
+
var trigger, _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps;
|
|
86
|
+
return __generator(this, function (_b) {
|
|
87
|
+
switch (_b.label) {
|
|
88
88
|
case 0:
|
|
89
|
-
if (!(mode === "childpipeline")) return [3 /*break*/, 3];
|
|
90
89
|
trigger = (0, getPipelineTriggerForGitlabChildPipeline_1.getPipelineTriggerForGitlabChildPipeline)();
|
|
91
90
|
return [4 /*yield*/, (0, createChildPipeline_1.createChildPipeline)(pipelineType, trigger, config)];
|
|
92
91
|
case 1:
|
|
93
|
-
_a =
|
|
92
|
+
_a = _b.sent(), jobs = _a.jobs, image = _a.image, stages = _a.stages, variables = _a.variables, workflow = _a.workflow, pipelineRest = __rest(_a, ["jobs", "image", "stages", "variables", "workflow"]);
|
|
94
93
|
jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(function (_a) {
|
|
95
94
|
var _b = __read(_a, 2), jobName = _b[0], job = _b[1];
|
|
96
95
|
return [
|
|
@@ -98,13 +97,20 @@ function generatePipelineFiles(config, pipelineType, mode) {
|
|
|
98
97
|
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
99
98
|
];
|
|
100
99
|
}));
|
|
101
|
-
return [
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
100
|
+
return [2 /*return*/, __assign(__assign({ image: image, stages: stages, variables: variables, workflow: workflow }, pipelineRest), jobsWithSortedProps)];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
exports.generateChildPipelineContent = generateChildPipelineContent;
|
|
106
|
+
function generateLocalPipelineContent(config, pipelineType) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
108
|
+
var _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps;
|
|
109
|
+
return __generator(this, function (_b) {
|
|
110
|
+
switch (_b.label) {
|
|
111
|
+
case 0: return [4 /*yield*/, (0, createMainPipeline_1.createMainPipeline)(pipelineType, config)];
|
|
112
|
+
case 1:
|
|
113
|
+
_a = _b.sent(), jobs = _a.jobs, image = _a.image, stages = _a.stages, variables = _a.variables, workflow = _a.workflow, pipelineRest = __rest(_a, ["jobs", "image", "stages", "variables", "workflow"]);
|
|
108
114
|
jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(function (_a) {
|
|
109
115
|
var _b = __read(_a, 2), jobName = _b[0], job = _b[1];
|
|
110
116
|
return [
|
|
@@ -112,11 +118,27 @@ function generatePipelineFiles(config, pipelineType, mode) {
|
|
|
112
118
|
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
113
119
|
];
|
|
114
120
|
}));
|
|
115
|
-
return [
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
121
|
+
return [2 /*return*/, __assign(__assign({ image: image, stages: stages, variables: variables, workflow: workflow }, pipelineRest), jobsWithSortedProps)];
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
exports.generateLocalPipelineContent = generateLocalPipelineContent;
|
|
127
|
+
function generatePipelineFiles(config, pipelineType, mode) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
129
|
+
var pipelineContent_1, pipelineContent;
|
|
130
|
+
return __generator(this, function (_a) {
|
|
131
|
+
switch (_a.label) {
|
|
132
|
+
case 0:
|
|
133
|
+
if (!(mode === "childpipeline")) return [3 /*break*/, 2];
|
|
134
|
+
return [4 /*yield*/, generateChildPipelineContent(config, pipelineType)];
|
|
135
|
+
case 1:
|
|
136
|
+
pipelineContent_1 = _a.sent();
|
|
137
|
+
return [2 /*return*/, (0, writeFiles_1.writeYamlfile)("__pipeline.yml", pipelineContent_1)];
|
|
138
|
+
case 2: return [4 /*yield*/, generateLocalPipelineContent(config, pipelineType)];
|
|
139
|
+
case 3:
|
|
140
|
+
pipelineContent = _a.sent();
|
|
141
|
+
return [2 /*return*/, (0, writeFiles_1.writeYamlfile)(".gitlab-ci.yml", pipelineContent)];
|
|
120
142
|
}
|
|
121
143
|
});
|
|
122
144
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePipelineFiles.js","sourceRoot":"","sources":["../../../../../pipeline/src/pipeline/generatePipelineFiles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoD;AACpD,6DAA4D;AAC5D,2DAA0D;AAC1D,8GAA6G;AAC7G,wEAAuE;
|
|
1
|
+
{"version":3,"file":"generatePipelineFiles.js","sourceRoot":"","sources":["../../../../../pipeline/src/pipeline/generatePipelineFiles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoD;AACpD,6DAA4D;AAC5D,2DAA0D;AAC1D,8GAA6G;AAC7G,wEAAuE;AAEvE,SAAsB,4BAA4B,CAChD,MAAc,EACd,YAAe;;;;;;oBAET,OAAO,GAAG,IAAA,mFAAwC,GAAE,CAAC;oBAEzD,qBAAM,IAAA,yCAAmB,EAAC,YAAY,EAAE,OAAO,EAAE,MAAM,CAAC,EAAA;;oBADpD,KACJ,SAAwD,EADlD,IAAI,UAAA,EAAE,KAAK,WAAA,EAAE,MAAM,YAAA,EAAE,SAAS,eAAA,EAAE,QAAQ,cAAA,EAAK,YAAY,cAA3D,oDAA6D,CAAF;oBAG3D,mBAAmB,GAAG,MAAM,CAAC,WAAW,CAC5C,MAAM,CAAC,OAAO,C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