@catladder/pipeline 2.0.5 → 2.1.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/build/base/writeDotEnv.js +0 -1
- package/dist/build/docker.js +0 -1
- package/dist/build/node/meteor.js +0 -1
- package/dist/build/rails/test.js +0 -1
- package/dist/catladder-gitlab.js +2 -3
- package/dist/config/readConfig.js +0 -1
- package/dist/constants.js +1 -1
- package/dist/context/getEnvironmentVariables.js +0 -1
- package/dist/context/getReviewSlug.js +0 -1
- package/dist/deploy/cloudRun/createJobs/index.js +0 -1
- package/dist/deploy/kubernetes/deployJob.js +0 -1
- package/dist/deploy/types/index.d.ts +3 -3
- package/dist/pipeline/generatePipelineFiles.d.ts +3 -22
- package/dist/pipeline/generatePipelineFiles.js +4 -39
- package/dist/pipeline/gitlab/gitlabReleaseJobs.d.ts +0 -2
- package/dist/pipeline/gitlab/gitlabReleaseJobs.js +2 -4
- package/dist/pipeline/index.d.ts +0 -1
- package/dist/pipeline/index.js +0 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/pipeline.d.ts +0 -1
- package/dist/utils/writeFiles.js +0 -2
- package/dist/variables/__tests__/resolveAllReferences.test.js +0 -1
- package/dist/variables/__tests__/resolveReferencesOnce.test.js +0 -3
- package/examples/__snapshots__/cloud-run-http2.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-memory-limit.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-meteor-with-worker.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-nextjs.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-non-public.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-service-custom-vpc-connector.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-service-custom-vpc.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-service-gen2.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-service-increase-timout.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-storybook.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-with-ngnix.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +0 -2
- package/examples/__snapshots__/cloud-run-with-worker.test.ts.snap +0 -2
- package/examples/__snapshots__/custom-build-job-with-tests.test.ts.snap +0 -2
- package/examples/__snapshots__/custom-build-job.test.ts.snap +0 -2
- package/examples/__snapshots__/custom-deploy.test.ts.snap +0 -2
- package/examples/__snapshots__/custom-envs.test.ts.snap +0 -2
- package/examples/__snapshots__/custom-sbom-java.test.ts.snap +0 -2
- package/examples/__snapshots__/git-submodule.test.ts.snap +0 -2
- package/examples/__snapshots__/kubernetes-application-customization.test.ts.snap +0 -2
- package/examples/__snapshots__/kubernetes-with-cloud-sql.test.ts.snap +0 -2
- package/examples/__snapshots__/kubernetes-with-jobs.test.ts.snap +0 -2
- package/examples/__snapshots__/kubernetes-with-mongodb.test.ts.snap +0 -2
- package/examples/__snapshots__/local-dot-env.test.ts.snap +0 -2
- package/examples/__snapshots__/meteor-kubernetes.test.ts.snap +0 -2
- package/examples/__snapshots__/multiline-var.test.ts.snap +0 -2
- package/examples/__snapshots__/native-app.test.ts.snap +0 -2
- package/examples/__snapshots__/node-build-with-custom-image.test.ts.snap +0 -2
- package/examples/__snapshots__/node-build-with-docker-additions.test.ts.snap +0 -2
- package/examples/__snapshots__/rails-k8s-with-worker-dockerfile.test.ts.snap +0 -2
- package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +0 -2
- package/examples/__snapshots__/referencing-other-vars.test.ts.snap +0 -2
- package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +0 -2
- package/examples/__snapshots__/workspace-api-www-turbo-cache.test.ts.snap +0 -2
- package/examples/__snapshots__/workspace-api-www.test.ts.snap +0 -2
- package/examples/__utils__/helpers.ts +1 -17
- package/package.json +16 -17
- package/src/build/cache/createJobCache.ts +2 -2
- package/src/build/sbom.ts +2 -2
- package/src/catladder-gitlab.ts +2 -9
- package/src/config/readConfig.ts +0 -1
- package/src/context/createComponentContext.ts +1 -1
- package/src/context/getEnvironmentVariables.ts +1 -1
- package/src/deploy/base/deploy.ts +3 -3
- package/src/deploy/cloudRun/createJobs/cloudRunServices.ts +1 -1
- package/src/pipeline/generatePipelineFiles.ts +1 -37
- package/src/pipeline/gitlab/gitlabReleaseJobs.ts +2 -4
- package/src/pipeline/index.ts +0 -1
- package/src/types/pipeline.ts +0 -4
- package/dist/pipeline/createChildPipeline.d.ts +0 -3
- package/dist/pipeline/createChildPipeline.js +0 -163
- package/dist/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.d.ts +0 -1
- package/dist/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.js +0 -29
- package/src/pipeline/createChildPipeline.ts +0 -37
- package/src/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.ts +0 -46
|
@@ -64,5 +64,4 @@ var componentContextNeedsBuildTimeDotEnv = function (context) {
|
|
|
64
64
|
var _a;
|
|
65
65
|
return ((_a = context.componentConfig.dotEnv) !== null && _a !== void 0 ? _a : true) === true; // don't build when set to `local`
|
|
66
66
|
};
|
|
67
|
-
|
|
68
67
|
exports.componentContextNeedsBuildTimeDotEnv = componentContextNeedsBuildTimeDotEnv;
|
package/dist/build/docker.js
CHANGED
|
@@ -110,7 +110,6 @@ var getDockerBuildRunnerVariables = function () {
|
|
|
110
110
|
DOCKER_BUILDKIT: "1" // see https://docs.docker.com/develop/develop-images/build_enhancements/
|
|
111
111
|
};
|
|
112
112
|
};
|
|
113
|
-
|
|
114
113
|
var getDockerAdditions = function (build) {
|
|
115
114
|
var _a, _b;
|
|
116
115
|
if (!("docker" in build)) return {};
|
|
@@ -61,7 +61,6 @@ var createMeteorBuildJobs = function (context) {
|
|
|
61
61
|
variables: {
|
|
62
62
|
METEOR_DISABLE_OPTIMISTIC_CACHING: "1" // see https://forums.meteor.com/t/veeery-long-building-time-inside-docker-container/58673/17?u=macrozone
|
|
63
63
|
},
|
|
64
|
-
|
|
65
64
|
script: __spreadArray(__spreadArray([], __read(yarnInstall), false), ['echo "add healthcheck package"', "meteor add panter:healthroute --allow-superuser", "meteor add qualia:prod-shell --allow-superuser", 'TOOL_NODE_FLAGS="--max_old_space_size=3584 --min_semi_space_size=8 --max_semi_space_size=256 --optimize_for_size" meteor build ./dist --architecture os.linux.x86_64 --allow-superuser --server-only --directory', "cp ./__build_info.json ./dist/bundle/programs/server"], false)
|
|
66
65
|
} : undefined,
|
|
67
66
|
dockerBuild: {
|
package/dist/build/rails/test.js
CHANGED
|
@@ -73,7 +73,6 @@ var createRailsTestJobs = function (context) {
|
|
|
73
73
|
files: ["Gemfile.lock"],
|
|
74
74
|
prefix: "$CI_JOB_IMAGE" // a changed image might have different OS libraries which no longer work with the cached gems
|
|
75
75
|
},
|
|
76
|
-
|
|
77
76
|
paths: [bundlerCacheDir]
|
|
78
77
|
};
|
|
79
78
|
var auditJob = buildConfig.audit !== false ? __assign(__assign({
|
package/dist/catladder-gitlab.js
CHANGED
|
@@ -120,8 +120,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
120
120
|
});
|
|
121
121
|
var config_1 = require("./config");
|
|
122
122
|
var generatePipelineFiles_1 = require("./pipeline/generatePipelineFiles");
|
|
123
|
-
|
|
124
|
-
var config = (0, config_1.readConfig)().then(function (result) {
|
|
123
|
+
(0, config_1.readConfig)().then(function (result) {
|
|
125
124
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
126
125
|
return __generator(this, function (_a) {
|
|
127
126
|
switch (_a.label) {
|
|
@@ -129,7 +128,7 @@ var config = (0, config_1.readConfig)().then(function (result) {
|
|
|
129
128
|
if (!(result === null || result === void 0 ? void 0 : result.config)) {
|
|
130
129
|
throw new Error("no catladder config found");
|
|
131
130
|
}
|
|
132
|
-
return [4 /*yield*/, (0, generatePipelineFiles_1.generatePipelineFiles)(result.config, "gitlab"
|
|
131
|
+
return [4 /*yield*/, (0, generatePipelineFiles_1.generatePipelineFiles)(result.config, "gitlab")];
|
|
133
132
|
case 1:
|
|
134
133
|
_a.sent();
|
|
135
134
|
return [2 /*return*/];
|
|
@@ -151,7 +151,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
151
151
|
});
|
|
152
152
|
exports.readConfig = void 0;
|
|
153
153
|
var fs_1 = require("fs");
|
|
154
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
155
154
|
var tsx = require("tsx/cjs/api");
|
|
156
155
|
var yaml_1 = require("yaml");
|
|
157
156
|
// allows us to load ts files
|
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 = "v2-0-
|
|
7
|
+
exports.PIPELINE_IMAGE_TAG = "v2-1-0-912a803c" || "latest";
|
|
8
8
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || "git.panter.ch:5001/catladder/catladder";
|
|
@@ -246,7 +246,6 @@ var getEnvironmentVariables = function (ctx_1) {
|
|
|
246
246
|
}), {
|
|
247
247
|
shouldResolveReferences: false // we already do this here with replaceAllReferences recursivly until re replaced all
|
|
248
248
|
})];
|
|
249
|
-
|
|
250
249
|
case 1:
|
|
251
250
|
otherEnvVars = _a.sent().envVars;
|
|
252
251
|
return [2 /*return*/, otherEnvVars];
|
|
@@ -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" | "dockerTag" | "google-cloudrun"
|
|
14
|
+
export declare const isOfDeployType: <T extends ("kubernetes" | "custom" | "dockerTag" | "google-cloudrun")[]>(t: DeployConfig | false | null | undefined, ...types: T) => t is Extract<DeployConfigKubernetes, {
|
|
15
15
|
type: T[number];
|
|
16
|
-
}> | Extract<
|
|
16
|
+
}> | Extract<DeployConfigCustom, {
|
|
17
17
|
type: T[number];
|
|
18
18
|
}> | Extract<DeployConfigCloudRun, {
|
|
19
19
|
type: T[number];
|
|
20
|
-
}> | Extract<
|
|
20
|
+
}> | Extract<DeployConfigDockerTag, {
|
|
21
21
|
type: T[number];
|
|
22
22
|
}>;
|
|
@@ -1,23 +1,4 @@
|
|
|
1
|
-
import type { Config,
|
|
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 | undefined;
|
|
6
|
-
workflow: {
|
|
7
|
-
rules: {
|
|
8
|
-
if?: string | undefined;
|
|
9
|
-
changes?: import("../types/gitlab-ci-yml").Changes | undefined;
|
|
10
|
-
exists?: import("../types/gitlab-ci-yml").Exists | undefined;
|
|
11
|
-
variables?: import("../types/gitlab-ci-yml").RulesVariables | undefined;
|
|
12
|
-
when?: import("../types/gitlab-ci-yml").When | undefined;
|
|
13
|
-
start_in?: string | undefined;
|
|
14
|
-
allow_failure?: import("../types/gitlab-ci-yml").AllowFailure | undefined;
|
|
15
|
-
needs?: import("../types/gitlab-ci-yml").RulesNeeds | undefined;
|
|
16
|
-
}[];
|
|
17
|
-
} | undefined;
|
|
18
|
-
} & Omit<import("../types").Pipeline<T>, "image" | "jobs" | "variables" | "workflow" | "stages"> & {
|
|
19
|
-
[k: string]: import("../types").GitlabJobDef;
|
|
20
|
-
}>;
|
|
1
|
+
import type { Config, PipelineType } from "../types";
|
|
21
2
|
export declare function generateLocalPipelineContent<T extends PipelineType>(config: Config, pipelineType: T): Promise<{
|
|
22
3
|
image: string;
|
|
23
4
|
stages: string[];
|
|
@@ -34,7 +15,7 @@ export declare function generateLocalPipelineContent<T extends PipelineType>(con
|
|
|
34
15
|
needs?: import("../types/gitlab-ci-yml").RulesNeeds | undefined;
|
|
35
16
|
}[];
|
|
36
17
|
} | undefined;
|
|
37
|
-
} & Omit<import("../types").Pipeline<T>, "image" | "
|
|
18
|
+
} & Omit<import("../types").Pipeline<T>, "image" | "variables" | "workflow" | "stages" | "jobs"> & {
|
|
38
19
|
[k: string]: import("../types").GitlabJobDef;
|
|
39
20
|
}>;
|
|
40
|
-
export declare function generatePipelineFiles<T extends PipelineType>(config: Config, pipelineType: T
|
|
21
|
+
export declare function generatePipelineFiles<T extends PipelineType>(config: Config, pipelineType: T): Promise<void>;
|
|
@@ -158,39 +158,10 @@ var __read = this && this.__read || function (o, n) {
|
|
|
158
158
|
Object.defineProperty(exports, "__esModule", {
|
|
159
159
|
value: true
|
|
160
160
|
});
|
|
161
|
-
exports.generatePipelineFiles = exports.generateLocalPipelineContent =
|
|
161
|
+
exports.generatePipelineFiles = exports.generateLocalPipelineContent = void 0;
|
|
162
162
|
var writeFiles_1 = require("../utils/writeFiles");
|
|
163
|
-
var createChildPipeline_1 = require("./createChildPipeline");
|
|
164
163
|
var createMainPipeline_1 = require("./createMainPipeline");
|
|
165
|
-
var getPipelineTriggerForGitlabChildPipeline_1 = require("./gitlab/getPipelineTriggerForGitlabChildPipeline");
|
|
166
164
|
var sortGitLabJobDefProps_1 = require("./gitlab/sortGitLabJobDefProps");
|
|
167
|
-
function generateChildPipelineContent(config, pipelineType) {
|
|
168
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
169
|
-
var trigger, _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps;
|
|
170
|
-
return __generator(this, function (_b) {
|
|
171
|
-
switch (_b.label) {
|
|
172
|
-
case 0:
|
|
173
|
-
trigger = (0, getPipelineTriggerForGitlabChildPipeline_1.getPipelineTriggerForGitlabChildPipeline)();
|
|
174
|
-
return [4 /*yield*/, (0, createChildPipeline_1.createChildPipeline)(pipelineType, trigger, config)];
|
|
175
|
-
case 1:
|
|
176
|
-
_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"]);
|
|
177
|
-
jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(function (_a) {
|
|
178
|
-
var _b = __read(_a, 2),
|
|
179
|
-
jobName = _b[0],
|
|
180
|
-
job = _b[1];
|
|
181
|
-
return [jobName, (0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job)];
|
|
182
|
-
}));
|
|
183
|
-
return [2 /*return*/, __assign(__assign({
|
|
184
|
-
image: image,
|
|
185
|
-
stages: stages,
|
|
186
|
-
variables: variables,
|
|
187
|
-
workflow: workflow
|
|
188
|
-
}, pipelineRest), jobsWithSortedProps)];
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
exports.generateChildPipelineContent = generateChildPipelineContent;
|
|
194
165
|
function generateLocalPipelineContent(config, pipelineType) {
|
|
195
166
|
return __awaiter(this, void 0, void 0, function () {
|
|
196
167
|
var _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps;
|
|
@@ -217,20 +188,14 @@ function generateLocalPipelineContent(config, pipelineType) {
|
|
|
217
188
|
});
|
|
218
189
|
}
|
|
219
190
|
exports.generateLocalPipelineContent = generateLocalPipelineContent;
|
|
220
|
-
function generatePipelineFiles(config, pipelineType
|
|
191
|
+
function generatePipelineFiles(config, pipelineType) {
|
|
221
192
|
return __awaiter(this, void 0, void 0, function () {
|
|
222
|
-
var
|
|
193
|
+
var pipelineContent;
|
|
223
194
|
return __generator(this, function (_a) {
|
|
224
195
|
switch (_a.label) {
|
|
225
196
|
case 0:
|
|
226
|
-
if (!(mode === "childpipeline")) return [3 /*break*/, 2];
|
|
227
|
-
return [4 /*yield*/, generateChildPipelineContent(config, pipelineType)];
|
|
228
|
-
case 1:
|
|
229
|
-
pipelineContent_1 = _a.sent();
|
|
230
|
-
return [2 /*return*/, (0, writeFiles_1.writeYamlfile)("__pipeline.yml", pipelineContent_1)];
|
|
231
|
-
case 2:
|
|
232
197
|
return [4 /*yield*/, generateLocalPipelineContent(config, pipelineType)];
|
|
233
|
-
case
|
|
198
|
+
case 1:
|
|
234
199
|
pipelineContent = _a.sent();
|
|
235
200
|
return [2 /*return*/, (0, writeFiles_1.writeYamlfile)(".gitlab-ci.yml", pipelineContent)];
|
|
236
201
|
}
|
|
@@ -3,7 +3,6 @@ export declare const getGitlabReleaseJobs: () => {
|
|
|
3
3
|
stage: string;
|
|
4
4
|
image: string;
|
|
5
5
|
script: string[];
|
|
6
|
-
after_script: string[];
|
|
7
6
|
rules: {
|
|
8
7
|
if?: string | undefined;
|
|
9
8
|
changes?: import("../../types/gitlab-ci-yml").Changes | undefined;
|
|
@@ -19,7 +18,6 @@ export declare const getGitlabReleaseJobs: () => {
|
|
|
19
18
|
stage: string;
|
|
20
19
|
image: string;
|
|
21
20
|
script: string[];
|
|
22
|
-
after_script: string[];
|
|
23
21
|
needs: never[];
|
|
24
22
|
rules: {
|
|
25
23
|
if?: string | undefined;
|
|
@@ -12,14 +12,12 @@ var getGitlabReleaseJobs = function () {
|
|
|
12
12
|
return _a = {}, _a["create release"] = {
|
|
13
13
|
stage: "release",
|
|
14
14
|
image: (0, runner_1.getRunnerImage)("semantic-release"),
|
|
15
|
-
script: ["semanticRelease"],
|
|
16
|
-
after_script: [EXPIRED_TOKEN_HELP],
|
|
15
|
+
script: ["semanticRelease", EXPIRED_TOKEN_HELP],
|
|
17
16
|
rules: rules_1.RULES_RELEASE
|
|
18
17
|
}, _a["⚠️ force create release"] = {
|
|
19
18
|
stage: "release",
|
|
20
19
|
image: (0, runner_1.getRunnerImage)("semantic-release"),
|
|
21
|
-
script: ["semanticRelease"],
|
|
22
|
-
after_script: [EXPIRED_TOKEN_HELP],
|
|
20
|
+
script: ["semanticRelease", EXPIRED_TOKEN_HELP],
|
|
23
21
|
needs: [],
|
|
24
22
|
rules: rules_1.RULES_MANUAL_RELEASE
|
|
25
23
|
}, _a;
|
package/dist/pipeline/index.d.ts
CHANGED
package/dist/pipeline/index.js
CHANGED
|
@@ -22,7 +22,6 @@ var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
|
22
22
|
Object.defineProperty(exports, "__esModule", {
|
|
23
23
|
value: true
|
|
24
24
|
});
|
|
25
|
-
__exportStar(require("./createChildPipeline"), exports);
|
|
26
25
|
__exportStar(require("./createJobsForComponent"), exports);
|
|
27
26
|
__exportStar(require("./generatePipelineFiles"), exports);
|
|
28
27
|
__exportStar(require("./gitlab/gitlabReleaseJobs"), exports);
|