@catladder/cli 0.0.0-main-8ed10e0f → 0.0.0-main-9c03495f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundles/catenv/index.js +60 -26
- package/dist/bundles/cli/index.js +60 -26
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -39173,7 +39173,13 @@ exports.BUILD_TYPES = {
|
|
|
39173
39173
|
rails: {
|
|
39174
39174
|
jobs: rails_1.createRailsJobs,
|
|
39175
39175
|
defaults: function () {
|
|
39176
|
-
return {
|
|
39176
|
+
return {
|
|
39177
|
+
startCommand: "/cnb/process/web",
|
|
39178
|
+
cnbBuilder: {
|
|
39179
|
+
image: "heroku/buildpacks:20",
|
|
39180
|
+
packVersion: "0.28.0"
|
|
39181
|
+
}
|
|
39182
|
+
};
|
|
39177
39183
|
}
|
|
39178
39184
|
}
|
|
39179
39185
|
};
|
|
@@ -39703,31 +39709,56 @@ exports.getYarnInstall = getYarnInstall;
|
|
|
39703
39709
|
"use strict";
|
|
39704
39710
|
|
|
39705
39711
|
|
|
39706
|
-
var
|
|
39707
|
-
|
|
39708
|
-
|
|
39709
|
-
|
|
39710
|
-
|
|
39712
|
+
var __read = this && this.__read || function (o, n) {
|
|
39713
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
39714
|
+
if (!m) return o;
|
|
39715
|
+
var i = m.call(o),
|
|
39716
|
+
r,
|
|
39717
|
+
ar = [],
|
|
39718
|
+
e;
|
|
39719
|
+
try {
|
|
39720
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
39721
|
+
} catch (error) {
|
|
39722
|
+
e = {
|
|
39723
|
+
error: error
|
|
39724
|
+
};
|
|
39725
|
+
} finally {
|
|
39726
|
+
try {
|
|
39727
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
39728
|
+
} finally {
|
|
39729
|
+
if (e) throw e.error;
|
|
39711
39730
|
}
|
|
39712
|
-
|
|
39713
|
-
|
|
39714
|
-
return __assign.apply(this, arguments);
|
|
39731
|
+
}
|
|
39732
|
+
return ar;
|
|
39715
39733
|
};
|
|
39716
39734
|
exports.__esModule = true;
|
|
39717
39735
|
exports.createRailsBuildJobs = void 0;
|
|
39736
|
+
var types_1 = __nccwpck_require__(1197);
|
|
39718
39737
|
var docker_1 = __nccwpck_require__(3219);
|
|
39719
39738
|
var createRailsBuildJobs = function (context) {
|
|
39739
|
+
var _a, _b, _c, _d, _e, _f;
|
|
39740
|
+
var buildConfig = context.componentConfig.build;
|
|
39741
|
+
if (!(0, types_1.isOfBuildType)(buildConfig, "rails")) {
|
|
39742
|
+
// should not happen
|
|
39743
|
+
throw new Error("build type is not rails");
|
|
39744
|
+
}
|
|
39745
|
+
var cnbConf = buildConfig.cnbBuilder;
|
|
39746
|
+
// backwards compatabilty with CNB_ENV_VARS
|
|
39747
|
+
// TODO: remove when all projects are migrated
|
|
39748
|
+
var packEnvArgs = (_c = (_b = (_a = buildConfig.extraVars) === null || _a === void 0 ? void 0 : _a.CNB_ENV_VARS) === null || _b === void 0 ? void 0 : _b.split(" ").map(function (v) {
|
|
39749
|
+
return "--env '".concat(v, "'");
|
|
39750
|
+
})) !== null && _c !== void 0 ? _c : Object.entries((_d = cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.buildVars) !== null && _d !== void 0 ? _d : {}).map(function (_a) {
|
|
39751
|
+
var _b = __read(_a, 2),
|
|
39752
|
+
k = _b[0],
|
|
39753
|
+
v = _b[1];
|
|
39754
|
+
return "--env '".concat(k).concat(v ? "=".concat(v) : "", "'");
|
|
39755
|
+
});
|
|
39720
39756
|
return [(0, docker_1.createDockerBuildJobBase)(context, {
|
|
39721
|
-
variables:
|
|
39722
|
-
CNB_BUILDER: "heroku/buildpacks:18",
|
|
39723
|
-
CNB_ENV_VARS: "BUNDLE_GIT__PANTER__CH",
|
|
39724
|
-
CNB_EXTRA_ARGS: "",
|
|
39725
|
-
CNB_PACK_VERSION: "0.20.0"
|
|
39726
|
-
}, context.componentConfig.build.extraVars),
|
|
39757
|
+
variables: context.componentConfig.build.extraVars,
|
|
39727
39758
|
// custom script
|
|
39728
|
-
script: [docker_1.gitlabDockerLogin, "docker pull $DOCKER_CACHE_IMAGE || true", "wget --output-document=- https://github.com/buildpacks/pack/releases/download/v
|
|
39759
|
+
script: [docker_1.gitlabDockerLogin, "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",
|
|
39729
39760
|
// replace private git ssh gem sources with https to make bundler with credentials via env var work
|
|
39730
|
-
"sed --in-place 's|git@\\([^:]*\\):|https://\\1/|g' Gemfile Gemfile.lock", "
|
|
39761
|
+
"sed --in-place 's|git@\\([^:]*\\):|https://\\1/|g' Gemfile Gemfile.lock", "pack build \"$DOCKER_IMAGE:$DOCKER_IMAGE_TAG\" --builder '".concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.image, "' --publish --cache-image \"$DOCKER_CACHE_IMAGE\" ").concat(packEnvArgs.join(" "), " ").concat((_f = (_e = cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packExtraArgs) === null || _e === void 0 ? void 0 : _e.join(" ")) !== null && _f !== void 0 ? _f : "")]
|
|
39731
39762
|
})];
|
|
39732
39763
|
};
|
|
39733
39764
|
exports.createRailsBuildJobs = createRailsBuildJobs;
|
|
@@ -40074,7 +40105,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
40074
40105
|
|
|
40075
40106
|
exports.__esModule = true;
|
|
40076
40107
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
40077
|
-
exports.PIPELINE_IMAGE_TAG = "main-
|
|
40108
|
+
exports.PIPELINE_IMAGE_TAG = "main-9c03495f" || 0;
|
|
40078
40109
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
40079
40110
|
|
|
40080
40111
|
/***/ }),
|
|
@@ -40269,6 +40300,7 @@ var getEnvironment = function (config, componentName, env, commitInfo) {
|
|
|
40269
40300
|
url: url
|
|
40270
40301
|
},
|
|
40271
40302
|
fullName: envContext.fullName,
|
|
40303
|
+
slugPrefix: envContext.environmentSlugPrefix,
|
|
40272
40304
|
slug: envContext.environmentSlug,
|
|
40273
40305
|
shortName: env,
|
|
40274
40306
|
envVars: envVars,
|
|
@@ -40292,20 +40324,22 @@ exports.__esModule = true;
|
|
|
40292
40324
|
exports.getEnvironmentContext = void 0;
|
|
40293
40325
|
var getEnvConfig_1 = __nccwpck_require__(5706);
|
|
40294
40326
|
var getEnvType_1 = __nccwpck_require__(4811);
|
|
40295
|
-
var
|
|
40327
|
+
var getEnvironmentSlugPrefix = function (envConfig, env, commitInfo) {
|
|
40296
40328
|
var envType = (0, getEnvType_1.getEnvType)(env, envConfig);
|
|
40297
|
-
return envType === "review" && commitInfo ? "".concat(env, "-").concat(commitInfo.reviewSlug
|
|
40329
|
+
return envType === "review" && commitInfo ? "".concat(env, "-").concat(commitInfo.reviewSlug) : "".concat(env);
|
|
40298
40330
|
};
|
|
40299
40331
|
var getEnvironmentContext = function (config, env, componentName, commitInfo) {
|
|
40300
40332
|
var envConfigRaw = (0, getEnvConfig_1.getEnvConfig)(config, componentName, env);
|
|
40301
40333
|
var envType = (0, getEnvType_1.getEnvType)(env, envConfigRaw);
|
|
40302
|
-
var
|
|
40334
|
+
var environmentSlugPrefix = getEnvironmentSlugPrefix(envConfigRaw, env, commitInfo);
|
|
40335
|
+
var environmentSlug = "".concat(environmentSlugPrefix, "-").concat(componentName);
|
|
40303
40336
|
var gitlabEnvironmentName = envType === "review" && commitInfo ? "".concat(env, "/").concat(commitInfo.refName, "/").concat(componentName) : "".concat(env, "/").concat(componentName);
|
|
40304
40337
|
var fullName = "".concat(config.customerName, "-").concat(config.appName, "-").concat(environmentSlug);
|
|
40305
40338
|
return {
|
|
40306
40339
|
envConfigRaw: envConfigRaw,
|
|
40307
40340
|
deployConfigRaw: envConfigRaw.deploy,
|
|
40308
40341
|
buildConfigRaw: envConfigRaw.build,
|
|
40342
|
+
environmentSlugPrefix: environmentSlugPrefix,
|
|
40309
40343
|
environmentSlug: environmentSlug,
|
|
40310
40344
|
gitlabEnvironmentName: gitlabEnvironmentName,
|
|
40311
40345
|
fullName: fullName,
|
|
@@ -41509,15 +41543,15 @@ var jobName_1 = __nccwpck_require__(7311);
|
|
|
41509
41543
|
exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = "GCLOUD_DEPLOY_credentialsKey";
|
|
41510
41544
|
exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = "GCLOUD_RUN_canonicalHostSuffix";
|
|
41511
41545
|
var getCloudSqlVariables = function (_a) {
|
|
41512
|
-
var _b, _c, _d;
|
|
41546
|
+
var _b, _c, _d, _e;
|
|
41513
41547
|
var deployConfigRaw = _a.deployConfigRaw,
|
|
41514
|
-
|
|
41548
|
+
environmentSlugPrefix = _a.environmentSlugPrefix,
|
|
41515
41549
|
env = _a.env,
|
|
41516
41550
|
componentName = _a.componentName,
|
|
41517
41551
|
fullConfig = _a.fullConfig;
|
|
41518
41552
|
if (deployConfigRaw && deployConfigRaw.cloudSql) {
|
|
41519
|
-
var DB_NAME = [(_b = deployConfigRaw.cloudSql.dbNamePrefix) !== null && _b !== void 0 ? _b : "".concat(fullConfig.customerName, "-").concat(fullConfig.appName),
|
|
41520
|
-
var additionalQueryParamsString = Object.entries((
|
|
41553
|
+
var DB_NAME = [(_b = deployConfigRaw.cloudSql.dbNamePrefix) !== null && _b !== void 0 ? _b : "".concat(fullConfig.customerName, "-").concat(fullConfig.appName), environmentSlugPrefix, (_c = deployConfigRaw.cloudSql.dbBaseName) !== null && _c !== void 0 ? _c : componentName].filter(Boolean).join("-");
|
|
41554
|
+
var additionalQueryParamsString = Object.entries((_d = deployConfigRaw.cloudSql.dbAdditionalQueryParams) !== null && _d !== void 0 ? _d : {}).map(function (_a) {
|
|
41521
41555
|
var _b = __read(_a, 2),
|
|
41522
41556
|
key = _b[0],
|
|
41523
41557
|
value = _b[1];
|
|
@@ -41526,7 +41560,7 @@ var getCloudSqlVariables = function (_a) {
|
|
|
41526
41560
|
return {
|
|
41527
41561
|
CLOUD_SQL_INSTANCE_CONNECTION_NAME: deployConfigRaw.cloudSql.instanceConnectionName,
|
|
41528
41562
|
DB_NAME: DB_NAME,
|
|
41529
|
-
DB_USER: (
|
|
41563
|
+
DB_USER: (_e = deployConfigRaw.cloudSql.dbUser) !== null && _e !== void 0 ? _e : "postgres",
|
|
41530
41564
|
DB_PASSWORD: "$" + (0, context_1.getSecretVarName)(env, componentName, "DB_PASSWORD"),
|
|
41531
41565
|
DATABASE_URL: "postgresql://$DB_USER:$DB_PASSWORD@localhost/$DB_NAME?host=/cloudsql/$CLOUD_SQL_INSTANCE_CONNECTION_NAME".concat(additionalQueryParamsString),
|
|
41532
41566
|
DATABASE_JDBC_URL: "jdbc:postgresql:///$DB_NAME?cloudSqlInstance=$CLOUD_SQL_INSTANCE_CONNECTION_NAME&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=$DB_USER&password=$DB_PASSWORD".concat(additionalQueryParamsString)
|
|
@@ -350425,7 +350425,13 @@ exports.BUILD_TYPES = {
|
|
|
350425
350425
|
rails: {
|
|
350426
350426
|
jobs: rails_1.createRailsJobs,
|
|
350427
350427
|
defaults: function () {
|
|
350428
|
-
return {
|
|
350428
|
+
return {
|
|
350429
|
+
startCommand: "/cnb/process/web",
|
|
350430
|
+
cnbBuilder: {
|
|
350431
|
+
image: "heroku/buildpacks:20",
|
|
350432
|
+
packVersion: "0.28.0"
|
|
350433
|
+
}
|
|
350434
|
+
};
|
|
350429
350435
|
}
|
|
350430
350436
|
}
|
|
350431
350437
|
};
|
|
@@ -350955,31 +350961,56 @@ exports.getYarnInstall = getYarnInstall;
|
|
|
350955
350961
|
"use strict";
|
|
350956
350962
|
|
|
350957
350963
|
|
|
350958
|
-
var
|
|
350959
|
-
|
|
350960
|
-
|
|
350961
|
-
|
|
350962
|
-
|
|
350964
|
+
var __read = this && this.__read || function (o, n) {
|
|
350965
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
350966
|
+
if (!m) return o;
|
|
350967
|
+
var i = m.call(o),
|
|
350968
|
+
r,
|
|
350969
|
+
ar = [],
|
|
350970
|
+
e;
|
|
350971
|
+
try {
|
|
350972
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
350973
|
+
} catch (error) {
|
|
350974
|
+
e = {
|
|
350975
|
+
error: error
|
|
350976
|
+
};
|
|
350977
|
+
} finally {
|
|
350978
|
+
try {
|
|
350979
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
350980
|
+
} finally {
|
|
350981
|
+
if (e) throw e.error;
|
|
350963
350982
|
}
|
|
350964
|
-
|
|
350965
|
-
|
|
350966
|
-
return __assign.apply(this, arguments);
|
|
350983
|
+
}
|
|
350984
|
+
return ar;
|
|
350967
350985
|
};
|
|
350968
350986
|
exports.__esModule = true;
|
|
350969
350987
|
exports.createRailsBuildJobs = void 0;
|
|
350988
|
+
var types_1 = __nccwpck_require__(71197);
|
|
350970
350989
|
var docker_1 = __nccwpck_require__(33219);
|
|
350971
350990
|
var createRailsBuildJobs = function (context) {
|
|
350991
|
+
var _a, _b, _c, _d, _e, _f;
|
|
350992
|
+
var buildConfig = context.componentConfig.build;
|
|
350993
|
+
if (!(0, types_1.isOfBuildType)(buildConfig, "rails")) {
|
|
350994
|
+
// should not happen
|
|
350995
|
+
throw new Error("build type is not rails");
|
|
350996
|
+
}
|
|
350997
|
+
var cnbConf = buildConfig.cnbBuilder;
|
|
350998
|
+
// backwards compatabilty with CNB_ENV_VARS
|
|
350999
|
+
// TODO: remove when all projects are migrated
|
|
351000
|
+
var packEnvArgs = (_c = (_b = (_a = buildConfig.extraVars) === null || _a === void 0 ? void 0 : _a.CNB_ENV_VARS) === null || _b === void 0 ? void 0 : _b.split(" ").map(function (v) {
|
|
351001
|
+
return "--env '".concat(v, "'");
|
|
351002
|
+
})) !== null && _c !== void 0 ? _c : Object.entries((_d = cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.buildVars) !== null && _d !== void 0 ? _d : {}).map(function (_a) {
|
|
351003
|
+
var _b = __read(_a, 2),
|
|
351004
|
+
k = _b[0],
|
|
351005
|
+
v = _b[1];
|
|
351006
|
+
return "--env '".concat(k).concat(v ? "=".concat(v) : "", "'");
|
|
351007
|
+
});
|
|
350972
351008
|
return [(0, docker_1.createDockerBuildJobBase)(context, {
|
|
350973
|
-
variables:
|
|
350974
|
-
CNB_BUILDER: "heroku/buildpacks:18",
|
|
350975
|
-
CNB_ENV_VARS: "BUNDLE_GIT__PANTER__CH",
|
|
350976
|
-
CNB_EXTRA_ARGS: "",
|
|
350977
|
-
CNB_PACK_VERSION: "0.20.0"
|
|
350978
|
-
}, context.componentConfig.build.extraVars),
|
|
351009
|
+
variables: context.componentConfig.build.extraVars,
|
|
350979
351010
|
// custom script
|
|
350980
|
-
script: [docker_1.gitlabDockerLogin, "docker pull $DOCKER_CACHE_IMAGE || true", "wget --output-document=- https://github.com/buildpacks/pack/releases/download/v
|
|
351011
|
+
script: [docker_1.gitlabDockerLogin, "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",
|
|
350981
351012
|
// replace private git ssh gem sources with https to make bundler with credentials via env var work
|
|
350982
|
-
"sed --in-place 's|git@\\([^:]*\\):|https://\\1/|g' Gemfile Gemfile.lock", "
|
|
351013
|
+
"sed --in-place 's|git@\\([^:]*\\):|https://\\1/|g' Gemfile Gemfile.lock", "pack build \"$DOCKER_IMAGE:$DOCKER_IMAGE_TAG\" --builder '".concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.image, "' --publish --cache-image \"$DOCKER_CACHE_IMAGE\" ").concat(packEnvArgs.join(" "), " ").concat((_f = (_e = cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packExtraArgs) === null || _e === void 0 ? void 0 : _e.join(" ")) !== null && _f !== void 0 ? _f : "")]
|
|
350983
351014
|
})];
|
|
350984
351015
|
};
|
|
350985
351016
|
exports.createRailsBuildJobs = createRailsBuildJobs;
|
|
@@ -351326,7 +351357,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
351326
351357
|
|
|
351327
351358
|
exports.__esModule = true;
|
|
351328
351359
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
351329
|
-
exports.PIPELINE_IMAGE_TAG = "main-
|
|
351360
|
+
exports.PIPELINE_IMAGE_TAG = "main-9c03495f" || 0;
|
|
351330
351361
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
351331
351362
|
|
|
351332
351363
|
/***/ }),
|
|
@@ -351521,6 +351552,7 @@ var getEnvironment = function (config, componentName, env, commitInfo) {
|
|
|
351521
351552
|
url: url
|
|
351522
351553
|
},
|
|
351523
351554
|
fullName: envContext.fullName,
|
|
351555
|
+
slugPrefix: envContext.environmentSlugPrefix,
|
|
351524
351556
|
slug: envContext.environmentSlug,
|
|
351525
351557
|
shortName: env,
|
|
351526
351558
|
envVars: envVars,
|
|
@@ -351544,20 +351576,22 @@ exports.__esModule = true;
|
|
|
351544
351576
|
exports.getEnvironmentContext = void 0;
|
|
351545
351577
|
var getEnvConfig_1 = __nccwpck_require__(25706);
|
|
351546
351578
|
var getEnvType_1 = __nccwpck_require__(94811);
|
|
351547
|
-
var
|
|
351579
|
+
var getEnvironmentSlugPrefix = function (envConfig, env, commitInfo) {
|
|
351548
351580
|
var envType = (0, getEnvType_1.getEnvType)(env, envConfig);
|
|
351549
|
-
return envType === "review" && commitInfo ? "".concat(env, "-").concat(commitInfo.reviewSlug
|
|
351581
|
+
return envType === "review" && commitInfo ? "".concat(env, "-").concat(commitInfo.reviewSlug) : "".concat(env);
|
|
351550
351582
|
};
|
|
351551
351583
|
var getEnvironmentContext = function (config, env, componentName, commitInfo) {
|
|
351552
351584
|
var envConfigRaw = (0, getEnvConfig_1.getEnvConfig)(config, componentName, env);
|
|
351553
351585
|
var envType = (0, getEnvType_1.getEnvType)(env, envConfigRaw);
|
|
351554
|
-
var
|
|
351586
|
+
var environmentSlugPrefix = getEnvironmentSlugPrefix(envConfigRaw, env, commitInfo);
|
|
351587
|
+
var environmentSlug = "".concat(environmentSlugPrefix, "-").concat(componentName);
|
|
351555
351588
|
var gitlabEnvironmentName = envType === "review" && commitInfo ? "".concat(env, "/").concat(commitInfo.refName, "/").concat(componentName) : "".concat(env, "/").concat(componentName);
|
|
351556
351589
|
var fullName = "".concat(config.customerName, "-").concat(config.appName, "-").concat(environmentSlug);
|
|
351557
351590
|
return {
|
|
351558
351591
|
envConfigRaw: envConfigRaw,
|
|
351559
351592
|
deployConfigRaw: envConfigRaw.deploy,
|
|
351560
351593
|
buildConfigRaw: envConfigRaw.build,
|
|
351594
|
+
environmentSlugPrefix: environmentSlugPrefix,
|
|
351561
351595
|
environmentSlug: environmentSlug,
|
|
351562
351596
|
gitlabEnvironmentName: gitlabEnvironmentName,
|
|
351563
351597
|
fullName: fullName,
|
|
@@ -352761,15 +352795,15 @@ var jobName_1 = __nccwpck_require__(77311);
|
|
|
352761
352795
|
exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = "GCLOUD_DEPLOY_credentialsKey";
|
|
352762
352796
|
exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = "GCLOUD_RUN_canonicalHostSuffix";
|
|
352763
352797
|
var getCloudSqlVariables = function (_a) {
|
|
352764
|
-
var _b, _c, _d;
|
|
352798
|
+
var _b, _c, _d, _e;
|
|
352765
352799
|
var deployConfigRaw = _a.deployConfigRaw,
|
|
352766
|
-
|
|
352800
|
+
environmentSlugPrefix = _a.environmentSlugPrefix,
|
|
352767
352801
|
env = _a.env,
|
|
352768
352802
|
componentName = _a.componentName,
|
|
352769
352803
|
fullConfig = _a.fullConfig;
|
|
352770
352804
|
if (deployConfigRaw && deployConfigRaw.cloudSql) {
|
|
352771
|
-
var DB_NAME = [(_b = deployConfigRaw.cloudSql.dbNamePrefix) !== null && _b !== void 0 ? _b : "".concat(fullConfig.customerName, "-").concat(fullConfig.appName),
|
|
352772
|
-
var additionalQueryParamsString = Object.entries((
|
|
352805
|
+
var DB_NAME = [(_b = deployConfigRaw.cloudSql.dbNamePrefix) !== null && _b !== void 0 ? _b : "".concat(fullConfig.customerName, "-").concat(fullConfig.appName), environmentSlugPrefix, (_c = deployConfigRaw.cloudSql.dbBaseName) !== null && _c !== void 0 ? _c : componentName].filter(Boolean).join("-");
|
|
352806
|
+
var additionalQueryParamsString = Object.entries((_d = deployConfigRaw.cloudSql.dbAdditionalQueryParams) !== null && _d !== void 0 ? _d : {}).map(function (_a) {
|
|
352773
352807
|
var _b = __read(_a, 2),
|
|
352774
352808
|
key = _b[0],
|
|
352775
352809
|
value = _b[1];
|
|
@@ -352778,7 +352812,7 @@ var getCloudSqlVariables = function (_a) {
|
|
|
352778
352812
|
return {
|
|
352779
352813
|
CLOUD_SQL_INSTANCE_CONNECTION_NAME: deployConfigRaw.cloudSql.instanceConnectionName,
|
|
352780
352814
|
DB_NAME: DB_NAME,
|
|
352781
|
-
DB_USER: (
|
|
352815
|
+
DB_USER: (_e = deployConfigRaw.cloudSql.dbUser) !== null && _e !== void 0 ? _e : "postgres",
|
|
352782
352816
|
DB_PASSWORD: "$" + (0, context_1.getSecretVarName)(env, componentName, "DB_PASSWORD"),
|
|
352783
352817
|
DATABASE_URL: "postgresql://$DB_USER:$DB_PASSWORD@localhost/$DB_NAME?host=/cloudsql/$CLOUD_SQL_INSTANCE_CONNECTION_NAME".concat(additionalQueryParamsString),
|
|
352784
352818
|
DATABASE_JDBC_URL: "jdbc:postgresql:///$DB_NAME?cloudSqlInstance=$CLOUD_SQL_INSTANCE_CONNECTION_NAME&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=$DB_USER&password=$DB_PASSWORD".concat(additionalQueryParamsString)
|