@catladder/pipeline 0.0.0-next-c177efda → 0.0.0-next-e3ccf7d4
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/backends/github/GithubBackend.js +6 -4
- package/dist/backends/github/createGithubJobs.js +33 -6
- package/dist/backends/gitlab/GitlabBackend.js +2 -1
- package/dist/constants.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +10 -0
- package/examples/__snapshots__/automatic-releases.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-execute-script-on-deploy.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-existing-image.test.ts.snap +2 -2
- package/examples/__snapshots__/cloud-run-health-check-defaults.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-health-check-only-startup.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-health-check.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-http2.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-llama.test.ts.snap +2 -2
- package/examples/__snapshots__/cloud-run-memory-limit.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-meteor-with-worker.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-n8n.test.ts.snap +2 -2
- package/examples/__snapshots__/cloud-run-nextjs.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-non-public.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-service-custom-vpc-connector.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-service-custom-vpc.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-service-gen2.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-service-increase-timout.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-session-affinity.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-storybook.test.ts.snap +18 -2
- package/examples/__snapshots__/cloud-run-with-agents.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-with-gpu.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-with-ngnix.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-with-sql-legacy-jobs.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-with-sql-multiple-dbs.test.ts.snap +90 -6
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +60 -4
- package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-with-worker.test.ts.snap +30 -2
- package/examples/__snapshots__/cloud-run-worker-pool.test.ts.snap +30 -2
- package/examples/__snapshots__/custom-build-job-with-tests.test.ts.snap +30 -2
- package/examples/__snapshots__/custom-build-job.test.ts.snap +18 -2
- package/examples/__snapshots__/custom-deploy.test.ts.snap +30 -2
- package/examples/__snapshots__/custom-docker-file.test.ts.snap +30 -2
- package/examples/__snapshots__/custom-verify-job.test.ts.snap +31 -3
- package/examples/__snapshots__/git-submodule.test.ts.snap +30 -2
- package/examples/__snapshots__/kubernetes-application-customization.test.ts.snap +3 -3
- package/examples/__snapshots__/kubernetes-with-cloud-sql.test.ts.snap +31 -3
- package/examples/__snapshots__/kubernetes-with-jobs.test.ts.snap +6 -6
- package/examples/__snapshots__/kubernetes-with-mongodb.test.ts.snap +31 -3
- package/examples/__snapshots__/local-dot-env.test.ts.snap +30 -2
- package/examples/__snapshots__/meteor-kubernetes.test.ts.snap +31 -3
- package/examples/__snapshots__/multiline-var.test.ts.snap +63 -7
- package/examples/__snapshots__/native-app.test.ts.snap +51 -3
- package/examples/__snapshots__/node-build-with-custom-image.test.ts.snap +30 -2
- package/examples/__snapshots__/node-build-with-docker-additions.test.ts.snap +30 -2
- package/examples/__snapshots__/override-secrets.test.ts.snap +30 -2
- package/examples/__snapshots__/pipelines-config.test.ts.snap +31 -2
- package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +23 -3
- package/examples/__snapshots__/referencing-other-vars.test.ts.snap +71 -7
- package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +2 -2
- package/examples/__snapshots__/workspace-api-www-turbo-cache.test.ts.snap +28 -4
- package/examples/__snapshots__/workspace-api-www.test.ts.snap +28 -4
- package/examples/pipelines-config.ts +8 -0
- package/package.json +1 -1
- package/src/backends/github/GithubBackend.ts +11 -3
- package/src/backends/github/createGithubJobs.ts +37 -11
- package/src/backends/gitlab/GitlabBackend.ts +6 -1
- package/src/types/config.ts +11 -0
|
@@ -181,6 +181,7 @@ var path_1 = require("path");
|
|
|
181
181
|
var createAllJobs_1 = require("../../pipeline/createAllJobs");
|
|
182
182
|
var config_1 = require("../../types/config");
|
|
183
183
|
var ciVariables_1 = require("./ciVariables");
|
|
184
|
+
var index_1 = require("../index");
|
|
184
185
|
var createGithubJobs_1 = require("./createGithubJobs");
|
|
185
186
|
var jobImagesPlan_1 = require("../../customImages/jobImagesPlan");
|
|
186
187
|
var scriptFunctions_1 = require("./scriptFunctions");
|
|
@@ -290,7 +291,7 @@ var GithubBackend = /** @class */function () {
|
|
|
290
291
|
*/
|
|
291
292
|
GithubBackend.prototype.createWorkflows = function (config_2) {
|
|
292
293
|
return __awaiter(this, arguments, void 0, function (config, images, scripts) {
|
|
293
|
-
var workflows, reviewStopJobs, manualJobs, _loop_1, this_1, ALL_PIPELINE_TRIGGERS_1, ALL_PIPELINE_TRIGGERS_1_1, trigger, e_1_1;
|
|
294
|
+
var workflows, workflowEnv, reviewStopJobs, manualJobs, _loop_1, this_1, ALL_PIPELINE_TRIGGERS_1, ALL_PIPELINE_TRIGGERS_1_1, trigger, e_1_1;
|
|
294
295
|
var e_1, _a;
|
|
295
296
|
if (images === void 0) {
|
|
296
297
|
images = this.createImagesPlan(config);
|
|
@@ -302,6 +303,7 @@ var GithubBackend = /** @class */function () {
|
|
|
302
303
|
switch (_b.label) {
|
|
303
304
|
case 0:
|
|
304
305
|
workflows = {};
|
|
306
|
+
workflowEnv = __assign(__assign({}, ciVariables_1.GITHUB_INJECTED_WORKFLOW_ENV), (0, index_1.getPipelineOptions)(config, this.type).runnerVariables);
|
|
305
307
|
reviewStopJobs = {};
|
|
306
308
|
manualJobs = {};
|
|
307
309
|
_loop_1 = function (trigger) {
|
|
@@ -343,7 +345,7 @@ var GithubBackend = /** @class */function () {
|
|
|
343
345
|
}
|
|
344
346
|
if (Object.keys(jobs).length > 0) {
|
|
345
347
|
workflows["".concat(GENERATED_FILE_PREFIX).concat(workflowFileName(trigger))] = __assign(__assign(__assign({}, TRIGGER_WORKFLOWS[trigger]), workflowPermissions(images)), {
|
|
346
|
-
env:
|
|
348
|
+
env: workflowEnv,
|
|
347
349
|
jobs: __assign(__assign({}, makeEnsureImageGithubJobs(images)), jobs)
|
|
348
350
|
});
|
|
349
351
|
}
|
|
@@ -392,7 +394,7 @@ var GithubBackend = /** @class */function () {
|
|
|
392
394
|
}
|
|
393
395
|
}
|
|
394
396
|
}, workflowPermissions(images)), {
|
|
395
|
-
env:
|
|
397
|
+
env: workflowEnv,
|
|
396
398
|
jobs: __assign(__assign({}, makeEnsureImageGithubJobs(images)), reviewStopJobs)
|
|
397
399
|
});
|
|
398
400
|
}
|
|
@@ -412,7 +414,7 @@ var GithubBackend = /** @class */function () {
|
|
|
412
414
|
}
|
|
413
415
|
}
|
|
414
416
|
}, workflowPermissions(images)), {
|
|
415
|
-
env:
|
|
417
|
+
env: workflowEnv,
|
|
416
418
|
jobs: __assign(__assign({}, makeEnsureImageGithubJobs(images)), Object.fromEntries(Object.entries(manualJobs).map(function (_a) {
|
|
417
419
|
var _b = __read(_a, 2),
|
|
418
420
|
id = _b[0],
|
|
@@ -283,6 +283,37 @@ var makeGithubJob = function (context, job, allJobs, uploadProviderIds, images,
|
|
|
283
283
|
}))), isComponent ? getSecretsEnv(context, secretKinds) : {}), getReferencedSecretsEnv(runScript, secretKinds)), {
|
|
284
284
|
CL_JOB_IMAGE: image !== null && image !== void 0 ? image : "runner"
|
|
285
285
|
});
|
|
286
|
+
/**
|
|
287
|
+
* the github environment of the job — serving two purposes:
|
|
288
|
+
* deployment tracking on deploy jobs, and access to environment
|
|
289
|
+
* secrets (the repo-level cap of 100 secrets doesn't scale to
|
|
290
|
+
* multiple envs). Names are keyed by env NAME, never env type: an
|
|
291
|
+
* app can have several envs of the same type.
|
|
292
|
+
*
|
|
293
|
+
* - deploy jobs: `<env>-<component>` — static (unlike the former
|
|
294
|
+
* per-PR review names), so environment secrets can attach, and
|
|
295
|
+
* each component keeps its own deployment badge/url in the
|
|
296
|
+
* github ui. For review, PRs share the component's environment:
|
|
297
|
+
* a newer PR's deploy marks the previous one Inactive (the badge,
|
|
298
|
+
* not the app) — the price of a static name.
|
|
299
|
+
* - other jobs referencing secrets join the shared `<env>`
|
|
300
|
+
* environment — deliberately NOT the per-component one, whose
|
|
301
|
+
* Active deploy badge their deployment records would displace.
|
|
302
|
+
* NOTE: build-time and deploy-time vars are not differentiated
|
|
303
|
+
* yet, so this environment holds roughly ALL of the env's
|
|
304
|
+
* secrets (the build's dotenv references every component).
|
|
305
|
+
* - jobs without secret references get no environment
|
|
306
|
+
*/
|
|
307
|
+
var referencesSecrets = Object.values(env).some(function (value) {
|
|
308
|
+
return typeof value === "string" && (value.includes("${{ secrets.") || value.includes("${{ vars."));
|
|
309
|
+
});
|
|
310
|
+
var githubEnvironment = job.environment && isComponent ? __assign({
|
|
311
|
+
name: "".concat(context.env, "-").concat(context.name)
|
|
312
|
+
}, createsJobEnv ? {
|
|
313
|
+
url: "${{ steps.main.outputs.url }}"
|
|
314
|
+
} : {}) : referencesSecrets ? {
|
|
315
|
+
name: context.env
|
|
316
|
+
} : undefined;
|
|
286
317
|
var githubJob = __assign(__assign(__assign(__assign(__assign({
|
|
287
318
|
name: githubJobName(context, job.name),
|
|
288
319
|
"runs-on": "ubuntu-latest"
|
|
@@ -301,12 +332,8 @@ var makeGithubJob = function (context, job, allJobs, uploadProviderIds, images,
|
|
|
301
332
|
} : {})
|
|
302
333
|
} : {}), Object.keys(services).length > 0 ? {
|
|
303
334
|
services: services
|
|
304
|
-
} : {}),
|
|
305
|
-
environment:
|
|
306
|
-
name: context.environment.envType === "review" ? "review-pr${{ github.event.number }}-".concat(context.name) : "".concat(context.env, "-").concat(context.name)
|
|
307
|
-
}, createsJobEnv ? {
|
|
308
|
-
url: "${{ steps.main.outputs.url }}"
|
|
309
|
-
} : {})
|
|
335
|
+
} : {}), githubEnvironment ? {
|
|
336
|
+
environment: githubEnvironment
|
|
310
337
|
} : {}), {
|
|
311
338
|
env: env,
|
|
312
339
|
steps: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(skipCheckout ? [] : [{
|
|
@@ -174,6 +174,7 @@ var config_1 = require("../../types/config");
|
|
|
174
174
|
var createAllJobs_1 = require("../../pipeline/createAllJobs");
|
|
175
175
|
var jobImagesPlan_1 = require("../../customImages/jobImagesPlan");
|
|
176
176
|
var shippedCatci_1 = require("../../catci/shippedCatci");
|
|
177
|
+
var index_1 = require("../index");
|
|
177
178
|
var createGitlabJobs_1 = require("./createGitlabJobs");
|
|
178
179
|
var createGitlabPipeline_1 = require("./createGitlabPipeline");
|
|
179
180
|
var gitlabReleaseJobs_1 = require("./gitlabReleaseJobs");
|
|
@@ -395,7 +396,7 @@ var GitlabBackend = /** @class */function () {
|
|
|
395
396
|
context: null
|
|
396
397
|
}];
|
|
397
398
|
}))),
|
|
398
|
-
variables: config.runnerVariables
|
|
399
|
+
variables: __assign(__assign({}, config.runnerVariables), (0, index_1.getPipelineOptions)(config, this.type).runnerVariables)
|
|
399
400
|
})];
|
|
400
401
|
}
|
|
401
402
|
});
|
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 = "next-
|
|
7
|
+
exports.PIPELINE_IMAGE_TAG = "next-e3ccf7d4" || "latest";
|
|
8
8
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || "git.panter.ch:5001/catladder/catladder";
|