@catladder/pipeline 2.2.4 → 2.4.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/constants.js +1 -1
- package/dist/deploy/base/deploy.js +1 -1
- package/dist/deploy/cloudRun/createJobs/cloudRunJobs.js +7 -4
- package/dist/deploy/sbom.js +3 -2
- package/dist/deploy/types/googleCloudRun.d.ts +6 -0
- package/dist/pipeline/gitlab/createGitlabJobs.js +6 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/examples/__snapshots__/cloud-run-http2.test.ts.snap +16 -20
- package/examples/__snapshots__/cloud-run-memory-limit.test.ts.snap +16 -20
- package/examples/__snapshots__/cloud-run-meteor-with-worker.test.ts.snap +16 -20
- package/examples/__snapshots__/cloud-run-nextjs.test.ts.snap +16 -20
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.test.ts.snap +16 -20
- package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +16 -20
- package/examples/__snapshots__/cloud-run-non-public.test.ts.snap +16 -20
- package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +16 -20
- package/examples/__snapshots__/cloud-run-service-custom-vpc-connector.test.ts.snap +16 -20
- package/examples/__snapshots__/cloud-run-service-custom-vpc.test.ts.snap +16 -20
- package/examples/__snapshots__/cloud-run-service-gen2.test.ts.snap +16 -20
- package/examples/__snapshots__/cloud-run-service-increase-timout.test.ts.snap +16 -20
- package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +16 -20
- package/examples/__snapshots__/cloud-run-storybook.test.ts.snap +16 -20
- package/examples/__snapshots__/cloud-run-with-ngnix.test.ts.snap +16 -20
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +32 -40
- package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +20 -24
- package/examples/__snapshots__/cloud-run-with-worker.test.ts.snap +16 -20
- package/examples/__snapshots__/custom-build-job-with-tests.test.ts.snap +16 -20
- package/examples/__snapshots__/custom-build-job.test.ts.snap +16 -20
- package/examples/__snapshots__/custom-deploy.test.ts.snap +11 -113
- package/examples/__snapshots__/custom-sbom-java.test.ts.snap +16 -20
- package/examples/__snapshots__/custom-verify-job.test.ts.snap +1632 -0
- package/examples/__snapshots__/git-submodule.test.ts.snap +16 -20
- package/examples/__snapshots__/kubernetes-application-customization.test.ts.snap +20 -28
- package/examples/__snapshots__/kubernetes-with-cloud-sql.test.ts.snap +20 -28
- package/examples/__snapshots__/kubernetes-with-jobs.test.ts.snap +40 -56
- package/examples/__snapshots__/kubernetes-with-mongodb.test.ts.snap +20 -28
- package/examples/__snapshots__/local-dot-env.test.ts.snap +16 -20
- package/examples/__snapshots__/meteor-kubernetes.test.ts.snap +20 -28
- package/examples/__snapshots__/multiline-var.test.ts.snap +52 -68
- package/examples/__snapshots__/native-app.test.ts.snap +48 -24
- package/examples/__snapshots__/node-build-with-custom-image.test.ts.snap +16 -20
- package/examples/__snapshots__/node-build-with-docker-additions.test.ts.snap +16 -20
- package/examples/__snapshots__/rails-k8s-with-worker-dockerfile.test.ts.snap +20 -28
- package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +20 -28
- package/examples/__snapshots__/referencing-other-vars.test.ts.snap +52 -68
- package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +64 -8
- package/examples/__snapshots__/workspace-api-www-turbo-cache.test.ts.snap +32 -40
- package/examples/__snapshots__/workspace-api-www.test.ts.snap +32 -40
- package/examples/cloud-run-with-sql.ts +2 -1
- package/examples/custom-deploy.ts +8 -1
- package/examples/custom-verify-job.test.ts +11 -0
- package/examples/custom-verify-job.ts +64 -0
- package/package.json +1 -1
- package/src/deploy/base/deploy.ts +1 -1
- package/src/deploy/cloudRun/createJobs/cloudRunJobs.ts +11 -8
- package/src/deploy/sbom.ts +3 -2
- package/src/deploy/types/googleCloudRun.ts +6 -0
- package/src/pipeline/gitlab/createGitlabJobs.ts +6 -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 = "v2-
|
|
7
|
+
exports.PIPELINE_IMAGE_TAG = "v2-4-0-6d817e0e" || "latest";
|
|
8
8
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || "git.panter.ch:5001/catladder/catladder";
|
|
@@ -115,7 +115,7 @@ var createDeployJob = function (context, jobDefinition) {
|
|
|
115
115
|
environment: isStoppable ? {
|
|
116
116
|
on_stop: stop_1.STOP_JOB_NAME,
|
|
117
117
|
auto_stop_in: autoStop
|
|
118
|
-
} :
|
|
118
|
+
} : {},
|
|
119
119
|
jobTags: deployConfig ? deployConfig.jobTags : undefined
|
|
120
120
|
};
|
|
121
121
|
};
|
|
@@ -96,10 +96,13 @@ var getJobRunScripts = function (context, when) {
|
|
|
96
96
|
var job = _a.job;
|
|
97
97
|
return job.when === when;
|
|
98
98
|
}).map(function (_a) {
|
|
99
|
-
var
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
var _b;
|
|
100
|
+
var jobName = _a.jobName,
|
|
101
|
+
job = _a.job;
|
|
102
|
+
// always wait for completion for preStop and postStop jobs
|
|
103
|
+
// since stop will delete the jobs afterwards, so they will fail
|
|
104
|
+
var waitForCompletion = ["preStop", "postStop"].includes(when) ? true : "waitForCompletion" in job ? (_b = job.waitForCompletion) !== null && _b !== void 0 ? _b : false : false;
|
|
105
|
+
return getJobRunScriptForJob(context, jobName, waitForCompletion);
|
|
103
106
|
});
|
|
104
107
|
};
|
|
105
108
|
exports.getJobRunScripts = getJobRunScripts;
|
package/dist/deploy/sbom.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getDependencyTrackDeleteScript = exports.getDependencyTrackUploadScript = exports.sbomDeactivated = void 0;
|
|
7
|
+
var BashExpression_1 = require("../bash/BashExpression");
|
|
7
8
|
var sbom_1 = require("../build/sbom");
|
|
8
9
|
var context_1 = require("../types/context");
|
|
9
10
|
var sbomDeactivated = function (context) {
|
|
@@ -11,10 +12,10 @@ var sbomDeactivated = function (context) {
|
|
|
11
12
|
};
|
|
12
13
|
exports.sbomDeactivated = sbomDeactivated;
|
|
13
14
|
var getDependencyTrackUploadScript = function (context) {
|
|
14
|
-
return (0, exports.sbomDeactivated)(context) ? [] : ["echo 'Uploading SBOM to Dependency Track'", "/dtrackuploader https://dep.panter.swiss/ \"$DT_KEY_PROD\" upload \"".concat(context.fullConfig.customerName, "-").concat(context.fullConfig.appName, "/").concat(context.name, "\" \"").concat(
|
|
15
|
+
return (0, exports.sbomDeactivated)(context) ? [] : ["echo 'Uploading SBOM to Dependency Track'", "/dtrackuploader https://dep.panter.swiss/ \"$DT_KEY_PROD\" upload \"".concat(context.fullConfig.customerName, "-").concat(context.fullConfig.appName, "/").concat(context.name, "\" \"").concat((0, BashExpression_1.getBashVariable)("ROOT_URL"), "\" \"").concat(sbom_1.SBOM_FILE, "\" vex.json || true")];
|
|
15
16
|
};
|
|
16
17
|
exports.getDependencyTrackUploadScript = getDependencyTrackUploadScript;
|
|
17
18
|
var getDependencyTrackDeleteScript = function (context) {
|
|
18
|
-
return (0, exports.sbomDeactivated)(context) ? [] : ["echo 'Disabling component in Dependency Track'", "/dtrackuploader https://dep.panter.swiss/ \"$DT_KEY_PROD\" disable \"".concat(context.fullConfig.customerName, "-").concat(context.fullConfig.appName, "/").concat(context.name, "\" \"").concat(
|
|
19
|
+
return (0, exports.sbomDeactivated)(context) ? [] : ["echo 'Disabling component in Dependency Track'", "/dtrackuploader https://dep.panter.swiss/ \"$DT_KEY_PROD\" disable \"".concat(context.fullConfig.customerName, "-").concat(context.fullConfig.appName, "/").concat(context.name, "\" \"").concat((0, BashExpression_1.getBashVariable)("CI_ENVIRONMENT_URL"), "\" || true")];
|
|
19
20
|
};
|
|
20
21
|
exports.getDependencyTrackDeleteScript = getDependencyTrackDeleteScript;
|
|
@@ -176,6 +176,12 @@ export type DeployConfigCloudRunJobWithSchedule = DeployConfigCloudRunJobBase &
|
|
|
176
176
|
};
|
|
177
177
|
export type DeployConfigCloudRunJobNormal = DeployConfigCloudRunJobBase & {
|
|
178
178
|
when: "manual" | "preDeploy" | "postDeploy" | "preStop" | "postStop";
|
|
179
|
+
/**
|
|
180
|
+
* wait for completion of the job on preDeploy and postDeploy
|
|
181
|
+
*
|
|
182
|
+
* has no effect on preStop and postStop (which always wait for completion)
|
|
183
|
+
*/
|
|
184
|
+
waitForCompletion?: boolean;
|
|
179
185
|
};
|
|
180
186
|
export type DeployConfigCloudRunWithVolumes = {
|
|
181
187
|
/**
|
|
@@ -174,6 +174,7 @@ var defaults_1 = require("../../defaults");
|
|
|
174
174
|
var utils_1 = require("../../utils");
|
|
175
175
|
var gitlab_1 = require("../../utils/gitlab");
|
|
176
176
|
var removeUndefined_1 = require("../../utils/removeUndefined");
|
|
177
|
+
var BashExpression_1 = require("../../bash/BashExpression");
|
|
177
178
|
exports.GITLAB_ENVIRONMENT_URL_VARIABLE = "CL_GITLAB_ENVIRONMENT_URL";
|
|
178
179
|
var getFullJobName = function (_a) {
|
|
179
180
|
var type = _a.type,
|
|
@@ -311,15 +312,16 @@ var addGitlabEnvironment = function (context, catladderJobEnvironment, job, allJ
|
|
|
311
312
|
restEnvironment = __rest(catladderJobEnvironment, ["on_stop"]);
|
|
312
313
|
// those can be dynamic, so we therefore have to do this: https://docs.gitlab.com/ee/ci/environments/#set-a-dynamic-environment-url
|
|
313
314
|
var dotEnvFile = "gitlab_environment.env";
|
|
314
|
-
var scriptToAdd = ["echo \"".concat(exports.GITLAB_ENVIRONMENT_URL_VARIABLE, "=").concat(
|
|
315
|
+
var scriptToAdd = ["echo \"".concat(exports.GITLAB_ENVIRONMENT_URL_VARIABLE, "=").concat((0, BashExpression_1.getBashVariable)("ROOT_URL"), "\" >> ").concat(dotEnvFile)];
|
|
315
316
|
// this is NOT a bashVariable since it NEEDS to be used as a string in gitlab
|
|
316
317
|
var gitlabEnvironmentName = envType === "review" ? "".concat(env, "/$CI_COMMIT_REF_NAME/").concat(name) // FIXME: should be replaced with mr name as well
|
|
317
318
|
: "".concat(env, "/").concat(name);
|
|
318
319
|
return __assign(__assign({}, job), {
|
|
319
|
-
environment: __assign(__assign({
|
|
320
|
-
name: gitlabEnvironmentName
|
|
320
|
+
environment: __assign(__assign(__assign({
|
|
321
|
+
name: gitlabEnvironmentName
|
|
322
|
+
}, !catladderJobEnvironment.action || catladderJobEnvironment.action === "start" ? {
|
|
321
323
|
url: "$".concat(exports.GITLAB_ENVIRONMENT_URL_VARIABLE)
|
|
322
|
-
}, on_stop ? {
|
|
324
|
+
} : {}), on_stop ? {
|
|
323
325
|
on_stop: getFullReferencedJobNameFromComponent(on_stop, name, env, allJobs)
|
|
324
326
|
} : {}), restEnvironment),
|
|
325
327
|
artifacts: (0, lodash_1.merge)((_a = job.artifacts) !== null && _a !== void 0 ? _a : {}, {
|