@catladder/pipeline 0.0.0-next-84c974cd → 0.0.0-next-e2e4f00a
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/createAppBuildJob.js +3 -3
- package/dist/build/custom/testJob.js +12 -12
- package/dist/build/node/cache.js +1 -0
- package/dist/build/node/testJob.js +11 -11
- package/dist/build/rails/build.js +1 -1
- package/dist/build/rails/test.js +8 -8
- package/dist/build/types.d.ts +10 -0
- package/dist/bundles/catladder-gitlab/index.js +151 -71
- package/dist/constants.js +1 -1
- package/dist/context/__tests__/resolveReferences.test.js +22 -0
- package/dist/context/createComponentContext.js +1 -0
- package/dist/context/getEnvironment.js +2 -1
- package/dist/context/getEnvironmentVariables.d.ts +5 -2
- package/dist/context/getEnvironmentVariables.js +24 -17
- package/dist/context/resolveReferences.d.ts +4 -1
- package/dist/context/resolveReferences.js +16 -2
- package/dist/deploy/base/deploy.js +3 -3
- package/dist/deploy/cloudRun/index.js +2 -2
- package/dist/deploy/kubernetes/cloudSql/index.js +14 -3
- package/dist/deploy/kubernetes/deployJob.js +3 -1
- package/dist/deploy/kubernetes/index.js +2 -2
- package/dist/deploy/kubernetes/kubeValues.d.ts +2 -1
- package/dist/deploy/kubernetes/kubeValues.js +3 -2
- package/dist/deploy/kubernetes/processSecretsAsFiles.d.ts +85 -0
- package/dist/deploy/kubernetes/processSecretsAsFiles.js +33 -0
- package/dist/deploy/types/base.d.ts +6 -0
- package/dist/deploy/types/kubernetes.d.ts +34 -1
- package/dist/pipeline/gitlab/createGitlabJobs.js +5 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +8 -0
- package/dist/types/context.d.ts +8 -0
- package/dist/types/jobs.d.ts +8 -0
- package/examples/__snapshots__/cloud-run-memory-limit.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-meteor-with-worker.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-non-public.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-service-custom-vpc.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-service-gen2.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-service-increase-timout.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-storybook.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-with-ngnix.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +104 -72
- package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +68 -48
- package/examples/__snapshots__/cloud-run-with-worker.test.ts.snap +52 -36
- package/examples/__snapshots__/custom-build-job-with-tests.test.ts.snap +52 -36
- package/examples/__snapshots__/custom-build-job.test.ts.snap +52 -36
- package/examples/__snapshots__/custom-deploy.test.ts.snap +32 -24
- package/examples/__snapshots__/custom-envs.test.ts.snap +24 -18
- package/examples/__snapshots__/custom-sbom-java.test.ts.snap +52 -36
- package/examples/__snapshots__/git-submodule.test.ts.snap +52 -36
- package/examples/__snapshots__/kubernetes-application-customization.test.ts.snap +96 -60
- package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.test.ts.snap +1791 -0
- package/examples/__snapshots__/kubernetes-with-cloud-sql.test.ts.snap +96 -60
- package/examples/__snapshots__/kubernetes-with-jobs.test.ts.snap +192 -120
- package/examples/__snapshots__/kubernetes-with-mongodb.test.ts.snap +96 -60
- package/examples/__snapshots__/local-dot-env.test.ts.snap +52 -36
- package/examples/__snapshots__/meteor-kubernetes.test.ts.snap +96 -60
- package/examples/__snapshots__/multiline-var.test.ts.snap +148 -96
- package/examples/__snapshots__/native-app.test.ts.snap +100 -72
- package/examples/__snapshots__/node-build-with-custom-image.test.ts.snap +52 -36
- package/examples/__snapshots__/node-build-with-docker-additions.test.ts.snap +52 -36
- package/examples/__snapshots__/rails-k8s-with-worker-dockerfile.test.ts.snap +80 -48
- package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +80 -48
- package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +64 -48
- package/examples/__snapshots__/workspace-api-www-custom-cache.test.ts.snap +104 -72
- package/examples/__snapshots__/workspace-api-www.test.ts.snap +104 -72
- package/examples/kubernetes-with-cloud-sql-legacy.test.ts +11 -0
- package/examples/kubernetes-with-cloud-sql-legacy.ts +35 -0
- package/examples/native-app.ts +6 -10
- package/examples/rails-k8s-with-worker.ts +1 -5
- package/package.json +1 -1
- package/src/build/base/createAppBuildJob.ts +1 -0
- package/src/build/custom/testJob.ts +1 -0
- package/src/build/node/cache.ts +1 -0
- package/src/build/node/testJob.ts +1 -0
- package/src/build/rails/build.ts +1 -0
- package/src/build/rails/test.ts +1 -0
- package/src/build/types.ts +13 -0
- package/src/context/__tests__/resolveReferences.test.ts +27 -1
- package/src/context/createComponentContext.ts +1 -0
- package/src/context/getEnvironment.ts +1 -1
- package/src/context/getEnvironmentVariables.ts +34 -13
- package/src/context/resolveReferences.ts +13 -0
- package/src/deploy/base/deploy.ts +1 -1
- package/src/deploy/cloudRun/index.ts +2 -2
- package/src/deploy/kubernetes/cloudSql/index.ts +15 -1
- package/src/deploy/kubernetes/deployJob.ts +2 -0
- package/src/deploy/kubernetes/index.ts +2 -2
- package/src/deploy/kubernetes/kubeValues.ts +8 -5
- package/src/deploy/kubernetes/processSecretsAsFiles.ts +35 -0
- package/src/deploy/types/base.ts +6 -0
- package/src/deploy/types/kubernetes.ts +36 -1
- package/src/pipeline/gitlab/createGitlabJobs.ts +4 -1
- package/src/types/config.ts +8 -0
- package/src/types/context.ts +8 -1
- package/src/types/jobs.ts +8 -0
|
@@ -23359,7 +23359,7 @@ var constants_1 = __nccwpck_require__(8821);
|
|
|
23359
23359
|
var writeBuildInfo_1 = __nccwpck_require__(8014);
|
|
23360
23360
|
var writeDotEnv_1 = __nccwpck_require__(2818);
|
|
23361
23361
|
var createAppBuildJob = function (context, _a) {
|
|
23362
|
-
var _b;
|
|
23362
|
+
var _b, _c;
|
|
23363
23363
|
var script = _a.script,
|
|
23364
23364
|
variables = _a.variables,
|
|
23365
23365
|
runnerVariables = _a.runnerVariables,
|
|
@@ -23372,8 +23372,8 @@ var createAppBuildJob = function (context, _a) {
|
|
|
23372
23372
|
image: (0, __1.getRunnerImage)("jobs-default"),
|
|
23373
23373
|
needs: [],
|
|
23374
23374
|
cache: cache ? (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, cache) : undefined,
|
|
23375
|
-
variables: __assign(__assign({}, variables !== null && variables !== void 0 ? variables : {}), context.type === "component" ? __assign(__assign({}, context.environment.envVars), context.environment.jobOnlyVars.build.envVars) : {}),
|
|
23376
|
-
runnerVariables: __assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), runnerVariables !== null && runnerVariables !== void 0 ? runnerVariables : {}), (
|
|
23375
|
+
variables: __assign(__assign({}, variables !== null && variables !== void 0 ? variables : {}), context.type === "component" ? __assign(__assign(__assign({}, context.environment.envVars), context.environment.jobOnlyVars.build.envVars), (_b = context.build.config.extraVars) !== null && _b !== void 0 ? _b : {}) : {}),
|
|
23376
|
+
runnerVariables: __assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), runnerVariables !== null && runnerVariables !== void 0 ? runnerVariables : {}), (_c = context.build.config.runnerVariables) !== null && _c !== void 0 ? _c : {}),
|
|
23377
23377
|
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(context.type === "component" ? (0, writeDotEnv_1.componentContextNeedsBuildTimeDotEnv)(context) ? (0, writeDotEnv_1.writeDotEnv)(context) : [] : context.type === "workspace" ? context.components.filter(function (c) {
|
|
23378
23378
|
return (0, writeDotEnv_1.componentContextNeedsBuildTimeDotEnv)(c);
|
|
23379
23379
|
}).flatMap(function (c) {
|
|
@@ -24055,7 +24055,7 @@ var RUNNER_CUSTOM_TEST_VARIABLES = {
|
|
|
24055
24055
|
KUBERNETES_MEMORY_LIMIT: "4Gi"
|
|
24056
24056
|
};
|
|
24057
24057
|
var createCustomTestJobs = function (context) {
|
|
24058
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
24058
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
24059
24059
|
// don't run tests after release
|
|
24060
24060
|
// TODO: this will be replaced by using rules
|
|
24061
24061
|
if (context.trigger === "taggedRelease") {
|
|
@@ -24066,9 +24066,9 @@ var createCustomTestJobs = function (context) {
|
|
|
24066
24066
|
throw new Error("deploy config is not custom");
|
|
24067
24067
|
}
|
|
24068
24068
|
var base = {
|
|
24069
|
-
variables: __assign({
|
|
24069
|
+
variables: __assign(__assign({
|
|
24070
24070
|
APP_PATH: context.build.dir
|
|
24071
|
-
}, context.environment.jobOnlyVars.build.envVars),
|
|
24071
|
+
}, context.environment.jobOnlyVars.build.envVars), (_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {}),
|
|
24072
24072
|
runnerVariables: RUNNER_CUSTOM_TEST_VARIABLES,
|
|
24073
24073
|
services: buildConfig.jobServices,
|
|
24074
24074
|
cache: (0, createJobCache_1.createJobCacheFromConfig)(context, buildConfig),
|
|
@@ -24079,23 +24079,23 @@ var createCustomTestJobs = function (context) {
|
|
|
24079
24079
|
var auditJob = buildConfig.audit ? __assign(__assign(__assign({
|
|
24080
24080
|
name: "🛡 audit"
|
|
24081
24081
|
}, base), {
|
|
24082
|
-
image: (
|
|
24082
|
+
image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : buildConfig.jobImage,
|
|
24083
24083
|
cache: undefined,
|
|
24084
|
-
script: __spreadArray([], __read((0, utils_1.ensureArray)((
|
|
24084
|
+
script: __spreadArray([], __read((0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)), false),
|
|
24085
24085
|
allow_failure: true
|
|
24086
|
-
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
24086
|
+
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.artifactsReports, (_f = buildConfig.audit) === null || _f === void 0 ? void 0 : _f.artifacts)) : null;
|
|
24087
24087
|
var lintJob = buildConfig.lint ? __assign(__assign(__assign({
|
|
24088
24088
|
name: "👮 lint"
|
|
24089
24089
|
}, base), {
|
|
24090
|
-
image: (
|
|
24091
|
-
script: __spreadArray([], __read((0, utils_1.ensureArray)((
|
|
24092
|
-
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
24090
|
+
image: (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : buildConfig.jobImage,
|
|
24091
|
+
script: __spreadArray([], __read((0, utils_1.ensureArray)((_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.command)), false)
|
|
24092
|
+
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.artifactsReports, (_l = buildConfig.lint) === null || _l === void 0 ? void 0 : _l.artifacts)) : null;
|
|
24093
24093
|
var testJob = buildConfig.test ? __assign(__assign(__assign({
|
|
24094
24094
|
name: "🧪 test"
|
|
24095
24095
|
}, base), {
|
|
24096
|
-
image: (
|
|
24097
|
-
script: __spreadArray([], __read((0, utils_1.ensureArray)((
|
|
24098
|
-
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
24096
|
+
image: (_o = (_m = buildConfig.test) === null || _m === void 0 ? void 0 : _m.jobImage) !== null && _o !== void 0 ? _o : buildConfig.jobImage,
|
|
24097
|
+
script: __spreadArray([], __read((0, utils_1.ensureArray)((_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.command)), false)
|
|
24098
|
+
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.artifactsReports, (_r = buildConfig.test) === null || _r === void 0 ? void 0 : _r.artifacts)) : null;
|
|
24099
24099
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
24100
24100
|
};
|
|
24101
24101
|
exports.createCustomTestJobs = createCustomTestJobs;
|
|
@@ -24551,6 +24551,7 @@ var getYarnCache = function (context, policy) {
|
|
|
24551
24551
|
var componentIsInWorkspace = context.type === "component" && context.packageManagerInfo.componentIsInWorkspace;
|
|
24552
24552
|
return [{
|
|
24553
24553
|
scope: componentIsInWorkspace ? "global" : "buildDir",
|
|
24554
|
+
pathMode: componentIsInWorkspace ? "absolute" : "relative",
|
|
24554
24555
|
key: "yarn",
|
|
24555
24556
|
policy: policy,
|
|
24556
24557
|
paths: [".yarn"]
|
|
@@ -24828,7 +24829,7 @@ var constants_1 = __nccwpck_require__(4899);
|
|
|
24828
24829
|
var yarn_1 = __nccwpck_require__(312);
|
|
24829
24830
|
var createJobCache_1 = __nccwpck_require__(659);
|
|
24830
24831
|
var createNodeTestJobs = function (context) {
|
|
24831
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
24832
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
24832
24833
|
// don't run tests after release
|
|
24833
24834
|
// TODO: this will be replaced by using rules
|
|
24834
24835
|
if (context.trigger === "taggedRelease") {
|
|
@@ -24842,7 +24843,7 @@ var createNodeTestJobs = function (context) {
|
|
|
24842
24843
|
var base = {
|
|
24843
24844
|
variables: __assign({
|
|
24844
24845
|
APP_PATH: context.build.dir
|
|
24845
|
-
}, context.type === "component" ? __assign({}, context.environment.jobOnlyVars.build.envVars) : {}),
|
|
24846
|
+
}, context.type === "component" ? __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), (_a = context.build.config.extraVars) !== null && _a !== void 0 ? _a : {}) : {}),
|
|
24846
24847
|
runnerVariables: constants_1.NODE_RUNNER_BUILD_VARIABLES,
|
|
24847
24848
|
stage: "test",
|
|
24848
24849
|
needs: [],
|
|
@@ -24853,26 +24854,26 @@ var createNodeTestJobs = function (context) {
|
|
|
24853
24854
|
var auditJob = buildConfig.audit !== false ? __assign(__assign(__assign({
|
|
24854
24855
|
name: "🛡 audit"
|
|
24855
24856
|
}, base), {
|
|
24856
|
-
image: (
|
|
24857
|
+
image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : defaultImage,
|
|
24857
24858
|
cache: undefined,
|
|
24858
|
-
script: __spreadArray(["cd ".concat(context.build.dir)], __read((
|
|
24859
|
+
script: __spreadArray(["cd ".concat(context.build.dir)], __read((_e = (0, utils_1.ensureArrayOrNull)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [context.packageManagerInfo.isClassic ? "yarn audit" : "yarn npm audit --environment production" // yarn 2
|
|
24859
24860
|
]), false),
|
|
24860
24861
|
allow_failure: true
|
|
24861
|
-
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
24862
|
+
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_f = buildConfig.audit) === null || _f === void 0 ? void 0 : _f.artifactsReports, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifacts)) : null;
|
|
24862
24863
|
var lintJob = buildConfig.lint !== false ? __assign(__assign(__assign({
|
|
24863
24864
|
name: "👮 lint"
|
|
24864
24865
|
}, base), {
|
|
24865
|
-
image: (
|
|
24866
|
+
image: (_j = (_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.jobImage) !== null && _j !== void 0 ? _j : defaultImage,
|
|
24866
24867
|
cache: (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, (0, cache_1.getNodeCache)(context)),
|
|
24867
|
-
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.build.dir)], false), __read(yarnInstall), false), __read((
|
|
24868
|
-
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
24868
|
+
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.build.dir)], false), __read(yarnInstall), false), __read((_l = (0, utils_1.ensureArrayOrNull)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : ["yarn lint"]), false)
|
|
24869
|
+
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_m = buildConfig.lint) === null || _m === void 0 ? void 0 : _m.artifactsReports, (_o = buildConfig.lint) === null || _o === void 0 ? void 0 : _o.artifacts)) : null;
|
|
24869
24870
|
var testJob = buildConfig.test !== false ? __assign(__assign(__assign({
|
|
24870
24871
|
name: "🧪 test"
|
|
24871
24872
|
}, base), {
|
|
24872
|
-
image: (
|
|
24873
|
+
image: (_q = (_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.jobImage) !== null && _q !== void 0 ? _q : (0, runner_1.getRunnerImage)("jobs-testing-chrome"),
|
|
24873
24874
|
cache: (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, (0, cache_1.getNodeCache)(context)),
|
|
24874
|
-
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.build.dir)], false), __read(yarnInstall), false), __read((
|
|
24875
|
-
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
24875
|
+
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.build.dir)], false), __read(yarnInstall), false), __read((_s = (0, utils_1.ensureArrayOrNull)((_r = buildConfig.test) === null || _r === void 0 ? void 0 : _r.command)) !== null && _s !== void 0 ? _s : ["yarn test"]), false)
|
|
24876
|
+
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_t = buildConfig.test) === null || _t === void 0 ? void 0 : _t.artifactsReports, (_u = buildConfig.test) === null || _u === void 0 ? void 0 : _u.artifacts)) : null;
|
|
24876
24877
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
24877
24878
|
};
|
|
24878
24879
|
exports.createNodeTestJobs = createNodeTestJobs;
|
|
@@ -25045,7 +25046,7 @@ var createRailsBuildJobs = function (context) {
|
|
|
25045
25046
|
return (0, base_1.createComponentBuildJobs)(context, {
|
|
25046
25047
|
appBuild: undefined,
|
|
25047
25048
|
dockerBuild: {
|
|
25048
|
-
variables: __assign({}, context.environment.jobOnlyVars.build.envVars),
|
|
25049
|
+
variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), context.build.config.extraVars),
|
|
25049
25050
|
// custom script
|
|
25050
25051
|
script: __spreadArray(__spreadArray([], __read((0, docker_1.gitlabDockerLogin)(context)), false), ["cd ".concat(context.build.dir), "docker pull $DOCKER_CACHE_IMAGE || true", "wget --output-document=- https://github.com/buildpacks/pack/releases/download/v".concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packVersion, "/pack-v").concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packVersion, "-linux.tgz | tar -zx --directory /usr/local/bin pack"), "chmod +x /usr/local/bin/pack",
|
|
25051
25052
|
// replace private git ssh gem sources with https to make bundler with credentials via env var work
|
|
@@ -25161,7 +25162,7 @@ exports.createRailsTestJobs = void 0;
|
|
|
25161
25162
|
var __1 = __nccwpck_require__(3223);
|
|
25162
25163
|
var utils_1 = __nccwpck_require__(1815);
|
|
25163
25164
|
var createRailsTestJobs = function (context) {
|
|
25164
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
25165
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
25165
25166
|
// don't run tests after release
|
|
25166
25167
|
// TODO: this will be replaced by using rules
|
|
25167
25168
|
if (context.trigger === "taggedRelease") {
|
|
@@ -25173,7 +25174,7 @@ var createRailsTestJobs = function (context) {
|
|
|
25173
25174
|
}
|
|
25174
25175
|
var buildConfig = context.build.config;
|
|
25175
25176
|
var base = {
|
|
25176
|
-
variables: __assign({}, context.environment.jobOnlyVars.build.envVars),
|
|
25177
|
+
variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), (_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {}),
|
|
25177
25178
|
stage: "test",
|
|
25178
25179
|
needs: [],
|
|
25179
25180
|
envMode: "none"
|
|
@@ -25193,23 +25194,23 @@ var createRailsTestJobs = function (context) {
|
|
|
25193
25194
|
name: "🛡 audit"
|
|
25194
25195
|
}, base), {
|
|
25195
25196
|
cache: undefined,
|
|
25196
|
-
image: (
|
|
25197
|
-
script: __spreadArray(["cd ".concat(context.build.dir)], __read((
|
|
25197
|
+
image: (_d = (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : buildConfig.jobImage) !== null && _d !== void 0 ? _d : defaultImage,
|
|
25198
|
+
script: __spreadArray(["cd ".concat(context.build.dir)], __read((_f = (0, utils_1.ensureArrayOrNull)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : ["gem install bundler-audit", "bundle audit check"]), false),
|
|
25198
25199
|
allow_failure: true
|
|
25199
25200
|
}) : null;
|
|
25200
25201
|
var lintJob = buildConfig.lint !== false ? __assign(__assign({
|
|
25201
25202
|
name: "👮 lint"
|
|
25202
25203
|
}, base), {
|
|
25203
25204
|
cache: bundlerCache,
|
|
25204
|
-
image: (
|
|
25205
|
-
script: __spreadArray(__spreadArray(["cd ".concat(context.build.dir)], __read(bundlerInstall), false), __read((
|
|
25205
|
+
image: (_j = (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : buildConfig.jobImage) !== null && _j !== void 0 ? _j : defaultImage,
|
|
25206
|
+
script: __spreadArray(__spreadArray(["cd ".concat(context.build.dir)], __read(bundlerInstall), false), __read((_l = (0, utils_1.ensureArrayOrNull)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : ["bundle exec rubocop"]), false)
|
|
25206
25207
|
}) : null;
|
|
25207
25208
|
var testJob = buildConfig.test !== false ? __assign(__assign({
|
|
25208
25209
|
name: "🧪 test"
|
|
25209
25210
|
}, base), {
|
|
25210
25211
|
cache: bundlerCache,
|
|
25211
|
-
image: (
|
|
25212
|
-
script: __spreadArray(__spreadArray(["cd ".concat(context.build.dir)], __read(bundlerInstall), false), __read((
|
|
25212
|
+
image: (_p = (_o = (_m = buildConfig.test) === null || _m === void 0 ? void 0 : _m.jobImage) !== null && _o !== void 0 ? _o : buildConfig.jobImage) !== null && _p !== void 0 ? _p : defaultImage,
|
|
25213
|
+
script: __spreadArray(__spreadArray(["cd ".concat(context.build.dir)], __read(bundlerInstall), false), __read((_r = (0, utils_1.ensureArrayOrNull)((_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.command)) !== null && _r !== void 0 ? _r : ["bundle exec rspec"]), false)
|
|
25213
25214
|
}) : null;
|
|
25214
25215
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
25215
25216
|
};
|
|
@@ -25762,7 +25763,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
25762
25763
|
value: true
|
|
25763
25764
|
}));
|
|
25764
25765
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
25765
|
-
exports.PIPELINE_IMAGE_TAG = "next-
|
|
25766
|
+
exports.PIPELINE_IMAGE_TAG = "next-e2e4f00a" || 0;
|
|
25766
25767
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
25767
25768
|
|
|
25768
25769
|
/***/ }),
|
|
@@ -26171,6 +26172,7 @@ var createComponentContext = function (ctx) {
|
|
|
26171
26172
|
context = {
|
|
26172
26173
|
type: "component",
|
|
26173
26174
|
name: ctx.componentName,
|
|
26175
|
+
componentName: ctx.componentName,
|
|
26174
26176
|
env: ctx.env,
|
|
26175
26177
|
fullConfig: ctx.config,
|
|
26176
26178
|
componentConfig: componentConfig,
|
|
@@ -26640,7 +26642,8 @@ var getEnvironment = function (ctx) {
|
|
|
26640
26642
|
fullName: envContext.fullName,
|
|
26641
26643
|
slugPrefix: envContext.environmentSlugPrefix,
|
|
26642
26644
|
reviewSlug: envContext.reviewSlug,
|
|
26643
|
-
slug: envContext.environmentSlug
|
|
26645
|
+
slug: envContext.environmentSlug,
|
|
26646
|
+
shortName: env
|
|
26644
26647
|
}, variables)];
|
|
26645
26648
|
}
|
|
26646
26649
|
});
|
|
@@ -26866,6 +26869,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
26866
26869
|
value: true
|
|
26867
26870
|
}));
|
|
26868
26871
|
exports.getSecretVarNameForContext = exports.getSecretVarName = exports.getEnvironmentVariables = void 0;
|
|
26872
|
+
var lodash_1 = __nccwpck_require__(3255);
|
|
26869
26873
|
var deploy_1 = __nccwpck_require__(1264);
|
|
26870
26874
|
var BashExpression_1 = __nccwpck_require__(5879);
|
|
26871
26875
|
var types_1 = __nccwpck_require__(6575);
|
|
@@ -26887,14 +26891,14 @@ var getEnvironmentVariables = function (ctx_1) {
|
|
|
26887
26891
|
args_1[_i - 1] = arguments[_i];
|
|
26888
26892
|
}
|
|
26889
26893
|
return __awaiter(void 0, __spreadArray([ctx_1], __read(args_1), false), void 0, function (ctx, alreadyVisited) {
|
|
26890
|
-
var environmentContext, config, env, componentName, envConfigRaw, deployConfigRaw, buildConfigRaw, envType, basePredefinedVariables, predefinedVariables, host, url, devLocalConfig, port, additionalEnvVars,
|
|
26894
|
+
var environmentContext, config, env, componentName, envConfigRaw, deployConfigRaw, buildConfigRaw, envType, basePredefinedVariables, predefinedVariables, host, url, devLocalConfig, port, additionalEnvVars, HOST_INTERNAL, publicEnvVarsRaw, additionalSecretKeys, secretEnvVarKeys, secretEnvVars, legacyFromComponents, publicEnvVarsRawWithLegacyFromComponents, publicEnvVarsRawSanitized, envVarsRaw, envVars;
|
|
26891
26895
|
var _a, _b;
|
|
26892
|
-
var _c, _d, _e, _f, _g, _h, _j;
|
|
26896
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
26893
26897
|
if (alreadyVisited === void 0) {
|
|
26894
26898
|
alreadyVisited = {};
|
|
26895
26899
|
}
|
|
26896
|
-
return __generator(this, function (
|
|
26897
|
-
switch (
|
|
26900
|
+
return __generator(this, function (_m) {
|
|
26901
|
+
switch (_m.label) {
|
|
26898
26902
|
case 0:
|
|
26899
26903
|
environmentContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
|
|
26900
26904
|
config = ctx.config, env = ctx.env, componentName = ctx.componentName;
|
|
@@ -26905,32 +26909,38 @@ var getEnvironmentVariables = function (ctx_1) {
|
|
|
26905
26909
|
port = (_c = devLocalConfig.port) !== null && _c !== void 0 ? _c : 3000;
|
|
26906
26910
|
host = "localhost:" + port.toString();
|
|
26907
26911
|
url = "http://" + host;
|
|
26908
|
-
predefinedVariables = __assign(__assign({}, basePredefinedVariables), {
|
|
26912
|
+
predefinedVariables = __assign(__assign(__assign(__assign({}, basePredefinedVariables), {
|
|
26909
26913
|
ENV_SHORT: "local",
|
|
26910
|
-
ROOT_URL: url
|
|
26911
|
-
|
|
26912
|
-
|
|
26914
|
+
ROOT_URL: url
|
|
26915
|
+
}), (0, types_1.isStandaloneBuildConfig)(buildConfigRaw) && buildConfigRaw.type === "rails" ? {} : {
|
|
26916
|
+
HOST: host
|
|
26917
|
+
}), {
|
|
26918
|
+
HOST_INTERNAL: host,
|
|
26913
26919
|
ROOT_URL_INTERNAL: "http://" + host,
|
|
26914
26920
|
PORT: port.toString()
|
|
26915
26921
|
});
|
|
26916
26922
|
} else {
|
|
26917
26923
|
additionalEnvVars = deployConfigRaw ? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].getAdditionalEnvVars(environmentContext) : {};
|
|
26918
|
-
|
|
26919
|
-
host = (_e = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _e !== void 0 ? _e :
|
|
26924
|
+
HOST_INTERNAL = (_d = additionalEnvVars.HOST_INTERNAL) !== null && _d !== void 0 ? _d : "unknown-host.example.com";
|
|
26925
|
+
host = (_e = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _e !== void 0 ? _e : HOST_INTERNAL;
|
|
26920
26926
|
url = (0, BashExpression_1.joinBashExpressions)(["https://", host]);
|
|
26921
26927
|
predefinedVariables = __assign(__assign(__assign(__assign({}, basePredefinedVariables), (0, types_1.isStandaloneBuildConfig)(buildConfigRaw) && buildConfigRaw.type === "rails" ? {} : {
|
|
26922
|
-
|
|
26928
|
+
HOST: host
|
|
26923
26929
|
}), {
|
|
26924
26930
|
ROOT_URL: url,
|
|
26925
|
-
|
|
26926
|
-
|
|
26931
|
+
HOST_INTERNAL: HOST_INTERNAL,
|
|
26932
|
+
/**@deprecated */
|
|
26933
|
+
HOST_CANONICAL: HOST_INTERNAL,
|
|
26934
|
+
ROOT_URL_INTERNAL: (0, BashExpression_1.joinBashExpressions)(["https://", HOST_INTERNAL])
|
|
26927
26935
|
}), additionalEnvVars);
|
|
26928
26936
|
}
|
|
26929
26937
|
publicEnvVarsRaw = (_g = (_f = envConfigRaw.vars) === null || _f === void 0 ? void 0 : _f.public) !== null && _g !== void 0 ? _g : {};
|
|
26930
26938
|
additionalSecretKeys = deployConfigRaw ? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].additionalSecretKeys(environmentContext) : [];
|
|
26931
26939
|
secretEnvVarKeys = __spreadArray(__spreadArray([], __read((0, envVars_1.stringListToSecreteEnvVarList)((_j = (_h = envConfigRaw.vars) === null || _h === void 0 ? void 0 : _h.secret) !== null && _j !== void 0 ? _j : [])), false), __read(additionalSecretKeys), false);
|
|
26932
26940
|
secretEnvVars = (0, envVars_1.makeSecretEnvVarMapping)(env, componentName, secretEnvVarKeys);
|
|
26933
|
-
|
|
26941
|
+
legacyFromComponents = (_l = (_k = envConfigRaw.vars) === null || _k === void 0 ? void 0 : _k.fromComponents) !== null && _l !== void 0 ? _l : {};
|
|
26942
|
+
publicEnvVarsRawWithLegacyFromComponents = (0, lodash_1.merge)({}, (0, resolveReferences_1.translateLegacyFromComponents)(legacyFromComponents), publicEnvVarsRaw);
|
|
26943
|
+
publicEnvVarsRawSanitized = (0, envVars_1.stringifyValues)(publicEnvVarsRawWithLegacyFromComponents);
|
|
26934
26944
|
envVarsRaw = addIndexVar(__assign(__assign(__assign({}, predefinedVariables), secretEnvVars), publicEnvVarsRawSanitized));
|
|
26935
26945
|
return [4 /*yield*/, (0, resolveReferences_1.resolveReferences)(envVarsRaw, function (otherComponentName, alreadyVisited) {
|
|
26936
26946
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -26949,7 +26959,7 @@ var getEnvironmentVariables = function (ctx_1) {
|
|
|
26949
26959
|
});
|
|
26950
26960
|
}, alreadyVisited)];
|
|
26951
26961
|
case 1:
|
|
26952
|
-
envVars =
|
|
26962
|
+
envVars = _m.sent();
|
|
26953
26963
|
_a = {
|
|
26954
26964
|
envVars: envVars,
|
|
26955
26965
|
secretEnvVarKeys: secretEnvVarKeys
|
|
@@ -26957,10 +26967,10 @@ var getEnvironmentVariables = function (ctx_1) {
|
|
|
26957
26967
|
_b = {};
|
|
26958
26968
|
return [4 /*yield*/, (0, transformJobOnlyVars_1.transformJobOnlyVars)(env, componentName, buildConfigRaw && (0, types_1.isStandaloneBuildConfig)(buildConfigRaw) && buildConfigRaw.jobVars || null)];
|
|
26959
26969
|
case 2:
|
|
26960
|
-
_b.build =
|
|
26970
|
+
_b.build = _m.sent();
|
|
26961
26971
|
return [4 /*yield*/, (0, transformJobOnlyVars_1.transformJobOnlyVars)(env, componentName, deployConfigRaw && deployConfigRaw.jobVars || null)];
|
|
26962
26972
|
case 3:
|
|
26963
|
-
return [2 /*return*/, (_a.jobOnlyVars = (_b.deploy =
|
|
26973
|
+
return [2 /*return*/, (_a.jobOnlyVars = (_b.deploy = _m.sent(), _b), _a.host = host, _a.url = url, _a)];
|
|
26964
26974
|
}
|
|
26965
26975
|
});
|
|
26966
26976
|
});
|
|
@@ -27256,7 +27266,7 @@ var __importDefault = this && this.__importDefault || function (mod) {
|
|
|
27256
27266
|
Object.defineProperty(exports, "__esModule", ({
|
|
27257
27267
|
value: true
|
|
27258
27268
|
}));
|
|
27259
|
-
exports.resolveReferences = void 0;
|
|
27269
|
+
exports.translateLegacyFromComponents = exports.resolveReferences = void 0;
|
|
27260
27270
|
var lodash_1 = __nccwpck_require__(3255);
|
|
27261
27271
|
var replaceAsync_1 = __importDefault(__nccwpck_require__(1686));
|
|
27262
27272
|
// regex to resolve references in catladder variables
|
|
@@ -27372,6 +27382,20 @@ var resolveReferences = function (vars_1, getOtherVariables_1) {
|
|
|
27372
27382
|
});
|
|
27373
27383
|
};
|
|
27374
27384
|
exports.resolveReferences = resolveReferences;
|
|
27385
|
+
var translateLegacyFromComponents = function (fromComponents) {
|
|
27386
|
+
return Object.fromEntries(Object.entries(fromComponents).flatMap(function (_a) {
|
|
27387
|
+
var _b = __read(_a, 2),
|
|
27388
|
+
componentName = _b[0],
|
|
27389
|
+
variables = _b[1];
|
|
27390
|
+
return Object.entries(variables).map(function (_a) {
|
|
27391
|
+
var _b = __read(_a, 2),
|
|
27392
|
+
ourName = _b[0],
|
|
27393
|
+
otherName = _b[1];
|
|
27394
|
+
return [ourName, "${" + componentName + ":" + otherName + "}"];
|
|
27395
|
+
});
|
|
27396
|
+
}));
|
|
27397
|
+
};
|
|
27398
|
+
exports.translateLegacyFromComponents = translateLegacyFromComponents;
|
|
27375
27399
|
|
|
27376
27400
|
/***/ }),
|
|
27377
27401
|
|
|
@@ -27683,7 +27707,7 @@ var stop_1 = __nccwpck_require__(7974);
|
|
|
27683
27707
|
var variables_1 = __nccwpck_require__(7119);
|
|
27684
27708
|
exports.DEPLOY_JOB_NAME = "🚀 Deploy";
|
|
27685
27709
|
var createDeployJob = function (context, jobDefinition) {
|
|
27686
|
-
var _a, _b, _c, _d, _e, _f;
|
|
27710
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
27687
27711
|
var hasDocker = (0, docker_1.requiresDockerBuild)(context);
|
|
27688
27712
|
var isStoppable = (0, utils_1.contextIsStoppable)(context);
|
|
27689
27713
|
var autoStop = context.environment.envType === "review" ? "1 week" : context.environment.envType === "dev" ? "4 weeks" : undefined;
|
|
@@ -27738,8 +27762,8 @@ var createDeployJob = function (context, jobDefinition) {
|
|
|
27738
27762
|
when: whenDeploy === "auto" ? "on_success" : "manual",
|
|
27739
27763
|
allow_failure: whenDeploy === "manual" ? true : false,
|
|
27740
27764
|
stage: "deploy",
|
|
27741
|
-
variables: __assign(__assign(__assign(__assign({}, context.environment.envVars), hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {}), context.environment.jobOnlyVars.deploy.envVars), jobDefinition.variables),
|
|
27742
|
-
runnerVariables: __assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), (
|
|
27765
|
+
variables: __assign(__assign(__assign(__assign(__assign({}, context.environment.envVars), hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {}), context.environment.jobOnlyVars.deploy.envVars), deployConfig ? (_e = deployConfig.extraVars) !== null && _e !== void 0 ? _e : {} : {}), jobDefinition.variables),
|
|
27766
|
+
runnerVariables: __assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), (_f = jobDefinition.runnerVariables) !== null && _f !== void 0 ? _f : {}), deployConfig ? (_g = deployConfig.runnerVariables) !== null && _g !== void 0 ? _g : {} : {}),
|
|
27743
27767
|
environment: isStoppable ? {
|
|
27744
27768
|
on_stop: stop_1.STOP_JOB_NAME,
|
|
27745
27769
|
auto_stop_in: autoStop
|
|
@@ -28969,7 +28993,7 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
28969
28993
|
env = ctx.env,
|
|
28970
28994
|
componentName = ctx.componentName,
|
|
28971
28995
|
deployConfigRaw = ctx.deployConfigRaw;
|
|
28972
|
-
var
|
|
28996
|
+
var HOST_INTERNAL = (0, BashExpression_1.joinBashExpressions)([fullName, (0, BashExpression_1.getBashVariable)((0, context_1.getSecretVarName)(env, componentName, exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX))], "-").toLowerCase();
|
|
28973
28997
|
var jobTriggers = deployConfigRaw && deployConfigRaw.jobs ? Object.fromEntries(Object.entries(deployConfigRaw.jobs).map(function (_a) {
|
|
28974
28998
|
var _b = __read(_a, 2),
|
|
28975
28999
|
name = _b[0],
|
|
@@ -28977,7 +29001,7 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
28977
29001
|
return ["CLOUD_RUN_JOB_TRIGGER_URL_" + (0, gitlab_1.sanitizeForBashVariable)(name), "https://".concat(deployConfigRaw.region, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(deployConfigRaw.projectId, "/jobs/").concat((0, jobName_1.getCloudRunJobName)(fullName, name), ":run")];
|
|
28978
29002
|
})) : {};
|
|
28979
29003
|
return __assign(__assign(__assign({
|
|
28980
|
-
|
|
29004
|
+
HOST_INTERNAL: HOST_INTERNAL
|
|
28981
29005
|
}, getCloudSqlVariables(ctx)), jobTriggers), {
|
|
28982
29006
|
DEPLOY_CLOUD_RUN_PROJECT_ID: deployConfigRaw ? deployConfigRaw.projectId : undefined,
|
|
28983
29007
|
DEPLOY_CLOUD_RUN_REGION: deployConfigRaw ? deployConfigRaw.region : undefined
|
|
@@ -29545,7 +29569,7 @@ var hasKubernetesCloudSQL = function (context) {
|
|
|
29545
29569
|
};
|
|
29546
29570
|
exports.hasKubernetesCloudSQL = hasKubernetesCloudSQL;
|
|
29547
29571
|
var createKubernetesCloudsqlBaseValues = function (context) {
|
|
29548
|
-
var _a, _b, _c;
|
|
29572
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
29549
29573
|
var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
|
|
29550
29574
|
if (!(0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
|
|
29551
29575
|
throw new Error("cannot get cloud sql config");
|
|
@@ -29555,11 +29579,22 @@ var createKubernetesCloudsqlBaseValues = function (context) {
|
|
|
29555
29579
|
throw new Error("cannot get cloud sql config");
|
|
29556
29580
|
}
|
|
29557
29581
|
var proxyCredentials = "$".concat((0, context_1.getSecretVarNameForContext)(context, "cloudsqlProxyCredentials"));
|
|
29558
|
-
if (config.type
|
|
29582
|
+
if ((config === null || config === void 0 ? void 0 : config.type) !== "unmanaged") {
|
|
29583
|
+
var instanceConnectionName = "".concat((_c = config.projectId) !== null && _c !== void 0 ? _c : "skynet-164509", ":").concat((_d = config.region) !== null && _d !== void 0 ? _d : "europe-west6", ":").concat((_e = config.instanceId) !== null && _e !== void 0 ? _e : context.environment.envVars.KUBE_NAMESPACE);
|
|
29584
|
+
return {
|
|
29585
|
+
cloudsql: {
|
|
29586
|
+
enabled: config.enabled,
|
|
29587
|
+
dbUser: "postgres",
|
|
29588
|
+
instanceConnectionName: instanceConnectionName,
|
|
29589
|
+
proxyCredentials: proxyCredentials,
|
|
29590
|
+
fullDbName: (_f = context.environment.envVars.KUBE_APP_NAME) !== null && _f !== void 0 ? _f : ""
|
|
29591
|
+
}
|
|
29592
|
+
};
|
|
29593
|
+
} else if (config.type === "unmanaged") {
|
|
29559
29594
|
return {
|
|
29560
29595
|
cloudsql: {
|
|
29561
29596
|
enabled: config.enabled,
|
|
29562
|
-
dbUser: (
|
|
29597
|
+
dbUser: (_g = config.dbUser) !== null && _g !== void 0 ? _g : "postgres",
|
|
29563
29598
|
instanceConnectionName: config.instanceConnectionName,
|
|
29564
29599
|
proxyCredentials: proxyCredentials,
|
|
29565
29600
|
fullDbName: (0, utils_1.getFullDbName)(config, context.fullConfig, context.environment.slugPrefix, context.name)
|
|
@@ -29656,7 +29691,9 @@ var createKubernetesDeployJobs = function (context) {
|
|
|
29656
29691
|
KUBE_DOCKER_IMAGE_PULL_SECRET: "gitlab-registry-".concat(context.name),
|
|
29657
29692
|
HELM_GITLAB_CHART_NAME: (_b = deployConfig.chartName) !== null && _b !== void 0 ? _b : "/helm-charts/the-panter-chart",
|
|
29658
29693
|
HELM_ARGS: __spreadArray(__spreadArray([], __read(deployConfig.debug ? ["--debug"] : []), false), __read((_c = deployConfig.additionalHelmArgs) !== null && _c !== void 0 ? _c : []), false).join(" "),
|
|
29659
|
-
COMPONENT_NAME: context.name
|
|
29694
|
+
COMPONENT_NAME: context.name,
|
|
29695
|
+
/** @deprecated */
|
|
29696
|
+
BUILD_ID: context.environment.envVars.BUILD_INFO_BUILD_ID
|
|
29660
29697
|
})
|
|
29661
29698
|
});
|
|
29662
29699
|
var clusterName = "kube-".concat(context.environment.fullName);
|
|
@@ -29769,12 +29806,12 @@ exports.KUBERNETES_DEPLOY_TYPE = {
|
|
|
29769
29806
|
var domainCanonical = deployConfigRaw && ((_b = deployConfigRaw.cluster) === null || _b === void 0 ? void 0 : _b.domainCanonical) ||
|
|
29770
29807
|
// for convenience, we allow clusters to define a canonical domain, because a cluster has a fixed ip and you will usually have a domain pointing to that cluster
|
|
29771
29808
|
fullConfig.domainCanonical || "panter.cloud";
|
|
29772
|
-
var
|
|
29809
|
+
var HOST_INTERNAL = (0, BashExpression_1.joinBashExpressions)(__spreadArray(__spreadArray([componentSlug], __read(envType === "review" && reviewSlug ? [reviewSlug] : []), false), [env, fullConfig.appName, fullConfig.customerName, domainCanonical], false), "."); // default for kubernetes and rest
|
|
29773
29810
|
return {
|
|
29774
29811
|
KUBE_NAMESPACE: KUBE_NAMESPACE,
|
|
29775
29812
|
KUBE_APP_NAME: KUBE_APP_NAME,
|
|
29776
29813
|
KUBE_APP_NAME_PREFIX: KUBE_APP_NAME_PREFIX,
|
|
29777
|
-
|
|
29814
|
+
HOST_INTERNAL: HOST_INTERNAL
|
|
29778
29815
|
};
|
|
29779
29816
|
}
|
|
29780
29817
|
};
|
|
@@ -29920,6 +29957,7 @@ var types_1 = __nccwpck_require__(4436);
|
|
|
29920
29957
|
var cloudSql_1 = __nccwpck_require__(442);
|
|
29921
29958
|
var kubeEnv_1 = __nccwpck_require__(5296);
|
|
29922
29959
|
var mongodb_1 = __nccwpck_require__(221);
|
|
29960
|
+
var processSecretsAsFiles_1 = __nccwpck_require__(5088);
|
|
29923
29961
|
var createAppConfig = function (context, application) {
|
|
29924
29962
|
if (application === false) {
|
|
29925
29963
|
return {
|
|
@@ -29983,10 +30021,10 @@ var createKubeValues = function (context) {
|
|
|
29983
30021
|
env: env,
|
|
29984
30022
|
application: createAppConfig(context, application)
|
|
29985
30023
|
}, (0, cloudSql_1.hasKubernetesCloudSQL)(context) ? (0, cloudSql_1.createKubernetesCloudsqlBaseValues)(context) : {}, ((_c = (_b = deployConfig.values) === null || _b === void 0 ? void 0 : _b.mongodb) === null || _c === void 0 ? void 0 : _c.enabled) ? (0, mongodb_1.createMongodbBaseConfig)(context) : {});
|
|
29986
|
-
var kubeValues = (0, utils_1.mergeWithMergingArrays)(defaultKubeValues, __assign({
|
|
30024
|
+
var kubeValues = (0, processSecretsAsFiles_1.processSecretsAsFiles)((0, utils_1.mergeWithMergingArrays)(defaultKubeValues, __assign({
|
|
29987
30025
|
jobs: removeFalsy(jobs),
|
|
29988
30026
|
cronjobs: removeFalsy(cronjobs)
|
|
29989
|
-
}, rest));
|
|
30027
|
+
}, rest)));
|
|
29990
30028
|
return kubeValues;
|
|
29991
30029
|
};
|
|
29992
30030
|
exports.createKubeValues = createKubeValues;
|
|
@@ -30112,6 +30150,46 @@ exports.createMongodbBaseConfig = createMongodbBaseConfig;
|
|
|
30112
30150
|
|
|
30113
30151
|
/***/ }),
|
|
30114
30152
|
|
|
30153
|
+
/***/ 5088:
|
|
30154
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
30155
|
+
|
|
30156
|
+
"use strict";
|
|
30157
|
+
|
|
30158
|
+
|
|
30159
|
+
var __assign = this && this.__assign || function () {
|
|
30160
|
+
__assign = Object.assign || function (t) {
|
|
30161
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
30162
|
+
s = arguments[i];
|
|
30163
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
30164
|
+
}
|
|
30165
|
+
return t;
|
|
30166
|
+
};
|
|
30167
|
+
return __assign.apply(this, arguments);
|
|
30168
|
+
};
|
|
30169
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
30170
|
+
value: true
|
|
30171
|
+
}));
|
|
30172
|
+
exports.processSecretsAsFiles = void 0;
|
|
30173
|
+
var lodash_1 = __nccwpck_require__(3255);
|
|
30174
|
+
var processSecretsAsFiles = function (values) {
|
|
30175
|
+
if (!values.secretsAsFile || values.secretsAsFile.length === 0) {
|
|
30176
|
+
return values;
|
|
30177
|
+
}
|
|
30178
|
+
// the initial idea was that we "shadow" secrets that we mount as files,
|
|
30179
|
+
// but there is a weird kubernetes issue with that (https://github.com/kubernetes/kubernetes/issues/46861),
|
|
30180
|
+
// so instead we rename the secrets and append _content, so that inside kuberentes, we can use the original name to contain the path and name+_content as the actual content
|
|
30181
|
+
return __assign(__assign({}, values), {
|
|
30182
|
+
env: __assign(__assign({}, values.env), {
|
|
30183
|
+
secret: __assign(__assign({}, (0, lodash_1.omit)(values.env.secret, values.secretsAsFile)), Object.fromEntries(values.secretsAsFile.map(function (key) {
|
|
30184
|
+
return [key + "_content", values.env.secret[key]];
|
|
30185
|
+
})))
|
|
30186
|
+
})
|
|
30187
|
+
});
|
|
30188
|
+
};
|
|
30189
|
+
exports.processSecretsAsFiles = processSecretsAsFiles;
|
|
30190
|
+
|
|
30191
|
+
/***/ }),
|
|
30192
|
+
|
|
30115
30193
|
/***/ 1634:
|
|
30116
30194
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
30117
30195
|
|
|
@@ -31684,6 +31762,7 @@ var makeGitlabJob = function (context, job, allJobs, baseRules) {
|
|
|
31684
31762
|
var environment = job.environment,
|
|
31685
31763
|
envMode = job.envMode,
|
|
31686
31764
|
needsStages = job.needsStages,
|
|
31765
|
+
needsOtherComponent = job.needsOtherComponent,
|
|
31687
31766
|
name = job.name,
|
|
31688
31767
|
needs = job.needs,
|
|
31689
31768
|
jobTags = job.jobTags,
|
|
@@ -31691,7 +31770,7 @@ var makeGitlabJob = function (context, job, allJobs, baseRules) {
|
|
|
31691
31770
|
variables = job.variables,
|
|
31692
31771
|
runnerVariables = job.runnerVariables,
|
|
31693
31772
|
when = job.when,
|
|
31694
|
-
rest = __rest(job, ["environment", "envMode", "needsStages", "name", "needs", "jobTags", "script", "variables", "runnerVariables", "when"]);
|
|
31773
|
+
rest = __rest(job, ["environment", "envMode", "needsStages", "needsOtherComponent", "name", "needs", "jobTags", "script", "variables", "runnerVariables", "when"]);
|
|
31695
31774
|
var stage = envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(context.env) : job.stage;
|
|
31696
31775
|
var deduplicatedGitlabNeeds = getGitlabNeeds(context, job, allJobs);
|
|
31697
31776
|
var fullJobName = getFullJobName({
|
|
@@ -31812,7 +31891,8 @@ function deduplicateNeeds(needs) {
|
|
|
31812
31891
|
}
|
|
31813
31892
|
function getGitlabNeedsForComponentJob(context, _a, allJobs) {
|
|
31814
31893
|
var needsStages = _a.needsStages,
|
|
31815
|
-
needs = _a.needs
|
|
31894
|
+
needs = _a.needs,
|
|
31895
|
+
needsOtherComponent = _a.needsOtherComponent;
|
|
31816
31896
|
var needsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap(function (n) {
|
|
31817
31897
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
31818
31898
|
var componentName = context.name;
|
|
@@ -31854,7 +31934,7 @@ function getGitlabNeedsForComponentJob(context, _a, allJobs) {
|
|
|
31854
31934
|
});
|
|
31855
31935
|
}
|
|
31856
31936
|
});
|
|
31857
|
-
var cleanedNeeds = __spreadArray(__spreadArray([], __read(needsFromStages !== null && needsFromStages !== void 0 ? needsFromStages : []), false), __read(needs !== null && needs !== void 0 ? needs : []), false);
|
|
31937
|
+
var cleanedNeeds = __spreadArray(__spreadArray(__spreadArray([], __read(needsFromStages !== null && needsFromStages !== void 0 ? needsFromStages : []), false), __read(needs !== null && needs !== void 0 ? needs : []), false), __read(needsOtherComponent !== null && needsOtherComponent !== void 0 ? needsOtherComponent : []), false);
|
|
31858
31938
|
return cleanedNeeds === null || cleanedNeeds === void 0 ? void 0 : cleanedNeeds.map(function (n) {
|
|
31859
31939
|
var _a;
|
|
31860
31940
|
return (0, lodash_1.isObject)(n) ? "workspaceName" in n ? {
|
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-e2e4f00a" || "latest";
|
|
8
8
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || "git.panter.ch:5001/catladder/catladder";
|
|
@@ -343,4 +343,26 @@ describe("resolveReferences", function () {
|
|
|
343
343
|
});
|
|
344
344
|
});
|
|
345
345
|
});
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
describe("translateLegacyFromComponents", function () {
|
|
349
|
+
it("translatetes the old `fromComponents` approach to ${componentName:variableName}", function () {
|
|
350
|
+
var fromComponents = {
|
|
351
|
+
api: {
|
|
352
|
+
API_FOO: "FOO",
|
|
353
|
+
API_BAR: "BAR"
|
|
354
|
+
},
|
|
355
|
+
www: {
|
|
356
|
+
WWW_X: "X",
|
|
357
|
+
WWW_Y: "Y"
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
var result = (0, resolveReferences_1.translateLegacyFromComponents)(fromComponents);
|
|
361
|
+
expect(result).toEqual({
|
|
362
|
+
API_FOO: "${api:FOO}",
|
|
363
|
+
API_BAR: "${api:BAR}",
|
|
364
|
+
WWW_X: "${www:X}",
|
|
365
|
+
WWW_Y: "${www:Y}"
|
|
366
|
+
});
|
|
367
|
+
});
|
|
346
368
|
});
|
|
@@ -148,7 +148,8 @@ var getEnvironment = function (ctx) {
|
|
|
148
148
|
fullName: envContext.fullName,
|
|
149
149
|
slugPrefix: envContext.environmentSlugPrefix,
|
|
150
150
|
reviewSlug: envContext.reviewSlug,
|
|
151
|
-
slug: envContext.environmentSlug
|
|
151
|
+
slug: envContext.environmentSlug,
|
|
152
|
+
shortName: env
|
|
152
153
|
}, variables)];
|
|
153
154
|
}
|
|
154
155
|
});
|
|
@@ -13,9 +13,12 @@ declare const getBasePredefinedVariables: (ctx: EnvironmentContext) => {
|
|
|
13
13
|
};
|
|
14
14
|
type BasePredefinedVariables = ReturnType<typeof getBasePredefinedVariables>;
|
|
15
15
|
export type PredefinedVariables = BasePredefinedVariables & {
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* undefined in rails, Rails before 6.1 (mis)uses the `HOST` environment variable to specify the IP to bind to
|
|
18
|
+
*/
|
|
19
|
+
HOST?: StringOrBashExpression;
|
|
17
20
|
ROOT_URL: StringOrBashExpression;
|
|
18
|
-
|
|
21
|
+
HOST_INTERNAL: StringOrBashExpression;
|
|
19
22
|
ROOT_URL_INTERNAL: StringOrBashExpression;
|
|
20
23
|
};
|
|
21
24
|
export declare const getEnvironmentVariables: (ctx: CreateComponentContextContext, alreadyVisited?: Record<string, Record<string, boolean>>) => Promise<EnvironmentVariables>;
|