@catladder/cli 2.1.0 → 2.2.0
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/bundles/catenv/index.js +3 -3
- package/dist/bundles/cli/index.js +1 -1
- package/dist/pipeline/src/pipeline/createMainPipeline.js +13 -7
- package/dist/pipeline/src/pipeline/createMainPipeline.js.map +1 -1
- package/dist/pipeline/src/pipeline/generatePipelineFiles.d.ts +5 -19
- package/dist/pipeline/src/pipeline/generatePipelineFiles.js +71 -20
- package/dist/pipeline/src/pipeline/generatePipelineFiles.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.d.ts +6 -4
- package/dist/pipeline/src/types/gitlab-types.d.ts +2 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ const createMainPipeline = async (pipelineType, config) => {
|
|
|
14
14
|
// for all triggers create jobs and add base rules
|
|
15
15
|
const allJobsPerTrigger = await Promise.all(config_1.ALL_PIPELINE_TRIGGERS.map(async (trigger) => await (0, createGitlabJobs_1.createGitlabJobs)(await (0, createAllJobs_1.createAllJobs)({ config, trigger, pipelineType }), getGitlabRulesForTrigger(trigger)))).then((j) => j.flat());
|
|
16
16
|
const allWorkspaceJobs = allJobsPerTrigger
|
|
17
|
-
.filter((j) => j.context.type === "workspace") // sort by componentName in the same order as they appear in the config
|
|
17
|
+
.filter((j) => { var _a; return ((_a = j.context) === null || _a === void 0 ? void 0 : _a.type) === "workspace"; }) // sort by componentName in the same order as they appear in the config
|
|
18
18
|
// this is purely for better readability in git diffs when you add new components
|
|
19
19
|
.sort((a, b) => {
|
|
20
20
|
var _a;
|
|
@@ -24,7 +24,7 @@ const createMainPipeline = async (pipelineType, config) => {
|
|
|
24
24
|
return aIndex - bIndex;
|
|
25
25
|
});
|
|
26
26
|
const allComponentJobs = allJobsPerTrigger
|
|
27
|
-
.filter((j) => j.context.type === "component")
|
|
27
|
+
.filter((j) => { var _a; return ((_a = j.context) === null || _a === void 0 ? void 0 : _a.type) === "component"; })
|
|
28
28
|
// sort by componentName in the same order as they appear in the config
|
|
29
29
|
// this is purely for better readability in git diffs when you add new components
|
|
30
30
|
.sort((a, b) => {
|
|
@@ -33,18 +33,18 @@ const createMainPipeline = async (pipelineType, config) => {
|
|
|
33
33
|
const bIndex = componentNames.findIndex((c) => c === b.context.name);
|
|
34
34
|
return aIndex - bIndex;
|
|
35
35
|
});
|
|
36
|
-
const allJobs = [...allWorkspaceJobs, ...allComponentJobs].reduce((acc, { gitlabJob, name }) => {
|
|
36
|
+
const allJobs = [...allWorkspaceJobs, ...allComponentJobs].reduce((acc, { gitlabJob, name, context }) => {
|
|
37
37
|
var _a, _b;
|
|
38
38
|
// merge jobs, if a job is already there, merge the rules
|
|
39
39
|
// this is currently needed because of envMode: "none", which creates the same job for all triggers, so it can appear multiple times
|
|
40
40
|
if (acc[name]) {
|
|
41
|
-
acc[name].rules = [
|
|
42
|
-
...((_a = acc[name].rules) !== null && _a !== void 0 ? _a : []),
|
|
41
|
+
acc[name].gitlabJob.rules = [
|
|
42
|
+
...((_a = acc[name].gitlabJob.rules) !== null && _a !== void 0 ? _a : []),
|
|
43
43
|
...((_b = gitlabJob.rules) !== null && _b !== void 0 ? _b : []),
|
|
44
44
|
];
|
|
45
45
|
}
|
|
46
46
|
else {
|
|
47
|
-
acc[name] = gitlabJob;
|
|
47
|
+
acc[name] = { context, gitlabJob };
|
|
48
48
|
}
|
|
49
49
|
return acc;
|
|
50
50
|
}, {});
|
|
@@ -52,7 +52,13 @@ const createMainPipeline = async (pipelineType, config) => {
|
|
|
52
52
|
stages: [...stages, "release"],
|
|
53
53
|
jobs: {
|
|
54
54
|
...allJobs,
|
|
55
|
-
...(0, gitlabReleaseJobs_1.getGitlabReleaseJobs)(),
|
|
55
|
+
...Object.fromEntries(Object.entries((0, gitlabReleaseJobs_1.getGitlabReleaseJobs)()).map(([name, gitlabJob]) => [
|
|
56
|
+
name,
|
|
57
|
+
{
|
|
58
|
+
gitlabJob,
|
|
59
|
+
context: null,
|
|
60
|
+
},
|
|
61
|
+
])),
|
|
56
62
|
},
|
|
57
63
|
variables: config.runnerVariables,
|
|
58
64
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMainPipeline.js","sourceRoot":"","sources":["../../../../../pipeline/src/pipeline/createMainPipeline.ts"],"names":[],"mappings":";;;AAAA,oCAKkB;
|
|
1
|
+
{"version":3,"file":"createMainPipeline.js","sourceRoot":"","sources":["../../../../../pipeline/src/pipeline/createMainPipeline.ts"],"names":[],"mappings":";;;AAAA,oCAKkB;AASlB,4CAAqE;AACrE,mDAAgD;AAChD,2DAAwD;AAExD,gEAA6D;AAC7D,wEAAiF;AACjF,kEAAkE;AAE3D,MAAM,kBAAkB,GAAG,KAAK,EACrC,YAAe,EACf,MAAc,EACQ,EAAE;IACxB,MAAM,MAAM,GAAG,IAAA,qCAAiB,EAAC,MAAM,CAAC,CAAC;IAEzC,IAAI,YAAY,KAAK,QAAQ,EAAE,CAAC;QAC9B,kDAAkD;QAElD,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,GAAG,CACzC,8BAAqB,CAAC,GAAG,CACvB,KAAK,EAAE,OAAO,EAAE,EAAE,CAChB,MAAM,IAAA,mCAAgB,EACpB,MAAM,IAAA,6BAAa,EAAC,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,EACtD,wBAAwB,CAAC,OAAO,CAAC,CAClC,CACJ,CACF,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAExB,MAAM,gBAAgB,GAAG,iBAAiB;aACvC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,WAAC,OAAA,CAAA,MAAA,CAAC,CAAC,OAAO,0CAAE,IAAI,MAAK,WAAW,CAAA,EAAA,CAAC,CAAC,uEAAuE;YACvH,iFAAiF;aAChF,IAAI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AAC,CAAC;QAC7D,KAAK,IAAI;YACP,OAAO,CAAC,6BAAqB,CAAC,CAAC;QACjC,KAAK,eAAe;YAClB,OAAO,CAAC,8BAAsB,CAAC,CAAC;IACpC,CAAC;AACH,CAAC"}
|
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
import type { Config, PipelineType } from "../types";
|
|
2
|
-
export declare function generateLocalPipelineContent<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
2
|
export declare function generatePipelineFiles<T extends PipelineType>(config: Config, pipelineType: T): Promise<void>;
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* for testing purposes
|
|
6
|
+
*/
|
|
7
|
+
export declare function getGitlabCompletePipeline(config: Config): Promise<{}>;
|
|
@@ -1,29 +1,80 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getGitlabCompletePipeline = exports.generatePipelineFiles = void 0;
|
|
4
|
+
const promises_1 = require("fs/promises");
|
|
5
|
+
const path_1 = require("path");
|
|
4
6
|
const writeFiles_1 = require("../utils/writeFiles");
|
|
5
7
|
const createMainPipeline_1 = require("./createMainPipeline");
|
|
6
8
|
const sortGitLabJobDefProps_1 = require("./gitlab/sortGitLabJobDefProps");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(([jobName, job]) => [
|
|
10
|
-
jobName,
|
|
11
|
-
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
12
|
-
]));
|
|
13
|
-
return {
|
|
14
|
-
image,
|
|
15
|
-
stages,
|
|
16
|
-
variables,
|
|
17
|
-
workflow,
|
|
18
|
-
...pipelineRest,
|
|
19
|
-
// jobs need to be spread into main YAML, because GitLab pipeline YAML has no jobs key - jobs are top level with their key as their name
|
|
20
|
-
...jobsWithSortedProps,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
exports.generateLocalPipelineContent = generateLocalPipelineContent;
|
|
9
|
+
const CATLADDER_GENERATED_FOLDER = ".catladder-generated";
|
|
10
|
+
const GITLAB_GENERATED_FOLDER = CATLADDER_GENERATED_FOLDER + "/gitlab";
|
|
24
11
|
async function generatePipelineFiles(config, pipelineType) {
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
if (pipelineType !== "gitlab") {
|
|
13
|
+
throw new Error("Pipeline type not supported");
|
|
14
|
+
}
|
|
15
|
+
const includes = await getGitlabPipelineIncludes(config);
|
|
16
|
+
const mainFile = {
|
|
17
|
+
path: ".gitlab-ci.yml",
|
|
18
|
+
content: {
|
|
19
|
+
include: includes.map((i) => i.path),
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
const files = [mainFile, ...includes];
|
|
23
|
+
// first clean up the folder
|
|
24
|
+
await (0, promises_1.rm)(GITLAB_GENERATED_FOLDER, { recursive: true });
|
|
25
|
+
// write files
|
|
26
|
+
await Promise.all(files.map(async ({ path, content }) => {
|
|
27
|
+
await (0, promises_1.mkdir)((0, path_1.dirname)(path), { recursive: true });
|
|
28
|
+
await (0, writeFiles_1.writeYamlfile)(path, content);
|
|
29
|
+
}));
|
|
27
30
|
}
|
|
28
31
|
exports.generatePipelineFiles = generatePipelineFiles;
|
|
32
|
+
async function getGitlabPipelineIncludes(config) {
|
|
33
|
+
const { jobs, image, stages, variables, workflow, ...pipelineRest } = await (0, createMainPipeline_1.createMainPipeline)("gitlab", config);
|
|
34
|
+
// we will create 1 include per component or workspace
|
|
35
|
+
// this is for better readability in git diffs and to avoid problems with yaml files beeing too large
|
|
36
|
+
// group by context
|
|
37
|
+
const groups = Object.entries(jobs).reduce((acc, [jobName, { gitlabJob, context }]) => {
|
|
38
|
+
const group = !context
|
|
39
|
+
? "global-jobs"
|
|
40
|
+
: (context === null || context === void 0 ? void 0 : context.type) + "/" + context.name;
|
|
41
|
+
if (!acc[group]) {
|
|
42
|
+
acc[group] = {};
|
|
43
|
+
}
|
|
44
|
+
acc[group][jobName] = (0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(gitlabJob); // also sort properties for more consistent diffing
|
|
45
|
+
return acc;
|
|
46
|
+
}, {});
|
|
47
|
+
const componentIncludes = Object.entries(groups).map(([group, jobs]) => {
|
|
48
|
+
return {
|
|
49
|
+
path: GITLAB_GENERATED_FOLDER + "/" + group + ".yaml",
|
|
50
|
+
content: jobs,
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
const mainInclude = {
|
|
54
|
+
path: GITLAB_GENERATED_FOLDER + "/main.yaml",
|
|
55
|
+
content: {
|
|
56
|
+
image,
|
|
57
|
+
stages,
|
|
58
|
+
variables,
|
|
59
|
+
workflow,
|
|
60
|
+
...pipelineRest,
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
const includes = [mainInclude, ...componentIncludes];
|
|
64
|
+
return includes;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
* for testing purposes
|
|
69
|
+
*/
|
|
70
|
+
async function getGitlabCompletePipeline(config) {
|
|
71
|
+
const includes = await getGitlabPipelineIncludes(config);
|
|
72
|
+
return includes.reduce((acc, { content }) => {
|
|
73
|
+
return {
|
|
74
|
+
...acc,
|
|
75
|
+
...content, // merge all includes into one object
|
|
76
|
+
};
|
|
77
|
+
}, {});
|
|
78
|
+
}
|
|
79
|
+
exports.getGitlabCompletePipeline = getGitlabCompletePipeline;
|
|
29
80
|
//# sourceMappingURL=generatePipelineFiles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePipelineFiles.js","sourceRoot":"","sources":["../../../../../pipeline/src/pipeline/generatePipelineFiles.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"generatePipelineFiles.js","sourceRoot":"","sources":["../../../../../pipeline/src/pipeline/generatePipelineFiles.ts"],"names":[],"mappings":";;;AAAA,0CAAwC;AACxC,+BAA+B;AAE/B,oDAAoD;AACpD,6DAA0D;AAC1D,0EAAuE;AAEvE,MAAM,0BAA0B,GAAG,sBAAsB,CAAC;AAE1D,MAAM,uBAAuB,GAAG,0BAA0B,GAAG,SAAS,CAAC;AAMhE,KAAK,UAAU,qBAAqB,CACzC,MAAc,EACd,YAAe;IAEf,IAAI,YAAY,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,yBAAyB,CAAC,MAAM,CAAC,CAAC;IAEzD,MAAM,QAAQ,GAAa;QACzB,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE;YACP,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;SACrC;KACF,CAAC;IAEF,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,GAAG,QAAQ,CAAC,CAAC;IAEtC,4BAA4B;IAC5B,MAAM,IAAA,aAAE,EAAC,uBAAuB,EAAE,EAAE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ACnD,CAAC;IAEF,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE;QACrE,OAAO;YACL,IAAI,EAAE,uBAAuB,GAAG,GAAG,GAAG,KAAK,GAAG,OAAO;YACrD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,WAAW,GAAa;QAC5B,IAAI,EAAE,uBAAuB,GAAG,YAAY;QAC5C,OAAO,EAAE;YACP,KAAK;YACL,MAAM;YACN,SAAS;YACT,QAAQ;YACR,GAAG,YAAY;SAChB;KACF,CAAC;IAEF,MAAM,QAAQ,GAAG,CAAC,WAAW,EAAE,GAAG,iBAAiB,CAAC,CAAC;IACrD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,yBAAyB,CAAC,MAAc;IAC5D,MAAM,QAAQ,GAAG,MAAM,yBAAyB,CAAC,MAAM,CAAC,CAAC;IAEzD,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,OAAO;YACL,GAAG,GAAG;YACN,GAAG,OAAO,EAAE,qCAAqC;SAClD,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AATD,8DASC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { Context, GitlabJobDef, GitlabRule } from "../../types";
|
|
2
2
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
3
|
import type { AllCatladderJobs } from "../createAllJobs";
|
|
4
|
-
export type
|
|
5
|
-
name: string;
|
|
4
|
+
export type GitlabJobWithContext = {
|
|
6
5
|
gitlabJob: GitlabJobDef;
|
|
7
|
-
context: Context;
|
|
8
|
-
}
|
|
6
|
+
context: Context | null;
|
|
7
|
+
};
|
|
8
|
+
export type AllGitlabJobs = (GitlabJobWithContext & {
|
|
9
|
+
name: string;
|
|
10
|
+
})[];
|
|
9
11
|
export declare const GITLAB_ENVIRONMENT_URL_VARIABLE = "CL_GITLAB_ENVIRONMENT_URL";
|
|
10
12
|
export declare const makeGitlabJob: (context: Context, job: CatladderJob<string>, allJobs: AllCatladderJobs, baseRules?: GitlabRule[]) => [fullName: string, job: GitlabJobDef];
|
|
11
13
|
export declare const createGitlabJobs: (allJobs: AllCatladderJobs, baseRules?: GitlabRule[]) => Promise<AllGitlabJobs>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GitlabJobWithContext } from "../pipeline/gitlab/createGitlabJobs";
|
|
1
2
|
import type { Artifacts as GitlabCiArtifacts, JobTemplate, Cache as GitlabJobCache, Rules } from "./gitlab-ci-yml";
|
|
2
3
|
export { Retry, Image as GitlabJobImage } from "./gitlab-ci-yml";
|
|
3
4
|
export type Artifacts = GitlabCiArtifacts;
|
|
@@ -22,6 +23,6 @@ export interface GitlabPipeline extends Pick<JobTemplate, "variables"> {
|
|
|
22
23
|
rules: GitlabRule[];
|
|
23
24
|
};
|
|
24
25
|
stages: string[];
|
|
25
|
-
jobs: Record<string,
|
|
26
|
+
jobs: Record<string, GitlabJobWithContext>;
|
|
26
27
|
before_script?: string[];
|
|
27
28
|
}
|