@catladder/cli 0.0.0-main-5bc1bdb9 → 0.0.0-main-0009a81d

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.
@@ -39882,7 +39882,7 @@ exports.readConfigSync = readConfigSync;
39882
39882
 
39883
39883
  exports.__esModule = true;
39884
39884
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
39885
- exports.PIPELINE_IMAGE_TAG = "main-5bc1bdb9" || 0;
39885
+ exports.PIPELINE_IMAGE_TAG = "main-0009a81d" || 0;
39886
39886
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
39887
39887
 
39888
39888
  /***/ }),
@@ -41108,13 +41108,15 @@ var types_1 = __nccwpck_require__(3109);
41108
41108
  var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(2607);
41109
41109
 
41110
41110
  var createGoogleCloudRunDeployJobs = function (context) {
41111
+ var _a, _b;
41112
+
41111
41113
  var deployConfig = context.componentConfig.deploy;
41112
41114
 
41113
41115
  if (deployConfig === false) {
41114
41116
  return [];
41115
41117
  }
41116
41118
 
41117
- if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun", "google-cloudrun-job")) {
41119
+ if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
41118
41120
  // should not happen
41119
41121
  throw new Error("deploy config is wrong");
41120
41122
  }
@@ -41135,44 +41137,76 @@ var createGoogleCloudRunDeployJobs = function (context) {
41135
41137
  return "".concat(key, "=").concat(value);
41136
41138
  }).join(",");
41137
41139
  var commonArgs = "--project ".concat(deployConfig.projectId, " --region=").concat(deployConfig.region);
41140
+ var commonDeployArgs = "--image ".concat(gcloudImageName, " ").concat(commonArgs, " --labels ").concat(labelsString);
41141
+ var serviceName = context.environment.fullName.toLowerCase();
41138
41142
 
41139
- var getDeployCommand = function () {
41143
+ var getServiceDeployScript = function (service) {
41140
41144
  var _a;
41141
41145
 
41142
- var name = context.environment.fullName.toLowerCase();
41143
- var command = (_a = deployConfig.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand;
41146
+ var command = service !== true ? (_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand : undefined;
41144
41147
  var commandArg = command ? "--command=\"".concat(command.split(" ").join(","), "\"") : "";
41145
- var commonDeployArgs = "".concat(commandArg, " --image ").concat(gcloudImageName, " ").concat(commonArgs, " --env-vars-file=____envvars.yaml --labels ").concat(labelsString);
41148
+ return "gcloud run deploy ".concat(serviceName, " ").concat(commandArg, " ").concat(commonDeployArgs, " --env-vars-file=____envvars.yaml --allow-unauthenticated");
41149
+ };
41146
41150
 
41147
- if (deployConfig.type === "google-cloudrun") {
41148
- return "gcloud run deploy ".concat(name, " ").concat(commonDeployArgs, " --allow-unauthenticated");
41149
- }
41151
+ var getJobDeployScripts = function (jobName, job) {
41152
+ // due to some oversight from google, jobs create does not accept `--env-vars-file` 🤦
41153
+ // lucky, update on the other hand accepts it... so let's just imediatly update it
41154
+ // also we cannot upsert a job, so we have to create it and catch the error and then update
41155
+ var args = "".concat(jobName, " --command=\"").concat(job.command.split(" ").join(","), "\" ").concat(commonDeployArgs);
41156
+ return ["set +e", "gcloud beta run jobs create ".concat(args), "set -e", "gcloud beta run jobs update ".concat(args, " --env-vars-file=____envvars.yaml")];
41157
+ };
41150
41158
 
41151
- if (deployConfig.type === "google-cloudrun-job") {
41152
- return "gcloud beta run jobs create ".concat(name, " ").concat(commonDeployArgs);
41153
- }
41159
+ var getJobRunScript = function (jobName) {
41160
+ return "gcloud beta run jobs execute ".concat(jobName, " ").concat(commonArgs);
41154
41161
  };
41155
41162
 
41156
- var getStopCommand = function () {
41157
- var name = context.environment.fullName.toLowerCase();
41158
- var commonStopArgs = "".concat(commonArgs, " --quiet");
41163
+ var getFullJobName = function (name) {
41164
+ return context.environment.fullName.toLowerCase() + "-" + name;
41165
+ };
41159
41166
 
41160
- if (deployConfig.type === "google-cloudrun") {
41161
- return "gcloud run services delete ".concat(name, " ").concat(commonStopArgs);
41162
- }
41167
+ var jobsWithNames = Object.entries((_a = deployConfig.jobs) !== null && _a !== void 0 ? _a : {}).map(function (_a) {
41168
+ var _b = __read(_a, 2),
41169
+ name = _b[0],
41170
+ job = _b[1];
41163
41171
 
41164
- if (deployConfig.type === "google-cloudrun-job") {
41165
- return "gcloud beta run jobs delete ".concat(name, " ").concat(commonStopArgs);
41166
- }
41167
- };
41172
+ return [getFullJobName(name), job];
41173
+ });
41174
+
41175
+ var cloudRunDeployScripts = __spreadArray(__spreadArray(__spreadArray(__spreadArray(["echo \"$ENV_VARS\" > ____envvars.yaml"], __read(jobsWithNames.map(function (_a) {
41176
+ var _b = __read(_a, 2),
41177
+ name = _b[0],
41178
+ job = _b[1];
41179
+
41180
+ return getJobDeployScripts(name, job);
41181
+ }).flat()), false), __read(deployConfig.service !== false ? [getServiceDeployScript(deployConfig.service)] : []), false), __read(jobsWithNames.filter(function (_a) {
41182
+ var _b = __read(_a, 2),
41183
+ name = _b[0],
41184
+ job = _b[1];
41185
+
41186
+ return job.when === "postDeploy";
41187
+ }).map(function (_a) {
41188
+ var _b = __read(_a, 2),
41189
+ name = _b[0],
41190
+ job = _b[1];
41191
+
41192
+ return getJobRunScript(name);
41193
+ })), false), ["docker image rm ".concat(gcloudImageName)], false);
41194
+
41195
+ var cloudRunStopScripts = __spreadArray(__spreadArray([], __read(deployConfig.service !== false ? ["gcloud run services delete ".concat(serviceName)] : []), false), __read(Object.entries((_b = deployConfig.jobs) !== null && _b !== void 0 ? _b : {}).map(function (_a) {
41196
+ var _b = __read(_a, 2),
41197
+ jobName = _b[0],
41198
+ job = _b[1];
41199
+
41200
+ return "gcloud beta run jobs delete ".concat(jobName);
41201
+ })), false);
41168
41202
 
41169
- var cloudRunDeploy = ["echo \"$ENV_VARS\" > ____envvars.yaml", getDeployCommand(), "docker image rm ".concat(gcloudImageName)];
41170
41203
  var baseStopJob = (0, base_1.getBaseDeploymentStopJob)(context);
41171
41204
  return [(0, lodash_1.merge)({}, baseDeploymentJob, (0, docker_1.getDockerJobBaseProps)(context), {
41172
41205
  artifacts: {
41173
41206
  paths: ["____envvars.yaml"]
41174
41207
  },
41175
41208
  variables: {
41209
+ CLOUDSDK_CORE_DISABLE_PROMPTS: "1",
41176
41210
  ENV_VARS: (0, js_yaml_1.dump)(allEnvVars, {
41177
41211
  lineWidth: -1,
41178
41212
  quotingType: "'",
@@ -41180,10 +41214,13 @@ var createGoogleCloudRunDeployJobs = function (context) {
41180
41214
  })
41181
41215
  },
41182
41216
  image: (0, runner_1.getRunnerImage)("gcloud"),
41183
- script: __spreadArray(__spreadArray([], __read(pushImageToArtifactsRegistry), false), __read(cloudRunDeploy), false)
41217
+ script: __spreadArray(__spreadArray([], __read(pushImageToArtifactsRegistry), false), __read(cloudRunDeployScripts), false)
41184
41218
  }), (0, lodash_1.merge)({}, baseStopJob, {
41185
41219
  image: (0, runner_1.getRunnerImage)("gcloud"),
41186
- script: __spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), [getStopCommand()], false)
41220
+ variables: {
41221
+ CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
41222
+ },
41223
+ script: __spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read(cloudRunStopScripts), false)
41187
41224
  })];
41188
41225
  };
41189
41226
 
@@ -41192,13 +41229,52 @@ exports.createGoogleCloudRunDeployJobs = createGoogleCloudRunDeployJobs;
41192
41229
  /***/ }),
41193
41230
 
41194
41231
  /***/ 1344:
41195
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
41232
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
41196
41233
 
41197
41234
  "use strict";
41198
41235
 
41199
41236
 
41237
+ var __assign = this && this.__assign || function () {
41238
+ __assign = Object.assign || function (t) {
41239
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
41240
+ s = arguments[i];
41241
+
41242
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41243
+ }
41244
+
41245
+ return t;
41246
+ };
41247
+
41248
+ return __assign.apply(this, arguments);
41249
+ };
41250
+
41251
+ var __read = this && this.__read || function (o, n) {
41252
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
41253
+ if (!m) return o;
41254
+ var i = m.call(o),
41255
+ r,
41256
+ ar = [],
41257
+ e;
41258
+
41259
+ try {
41260
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
41261
+ } catch (error) {
41262
+ e = {
41263
+ error: error
41264
+ };
41265
+ } finally {
41266
+ try {
41267
+ if (r && !r.done && (m = i["return"])) m.call(i);
41268
+ } finally {
41269
+ if (e) throw e.error;
41270
+ }
41271
+ }
41272
+
41273
+ return ar;
41274
+ };
41275
+
41200
41276
  exports.__esModule = true;
41201
- exports.GCLOUD_RUN_DEPLOY_TYPES = exports.GCLOUD_RUN_JOB_DEPLOY_TYPE = exports.GCLOUD_RUN_DEPLOY_TYPE = exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = void 0;
41277
+ exports.GCLOUD_RUN_DEPLOY_TYPE = exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = void 0;
41202
41278
 
41203
41279
  var context_1 = __nccwpck_require__(2041);
41204
41280
 
@@ -41217,40 +41293,21 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
41217
41293
  getAdditionalEnvVars: function (_a) {
41218
41294
  var fullName = _a.fullName,
41219
41295
  env = _a.env,
41220
- componentName = _a.componentName;
41296
+ componentName = _a.componentName,
41297
+ deployConfig = _a.deployConfig;
41221
41298
  var HOST_CANONICAL = fullName.toLowerCase() + "-" + process.env[(0, context_1.getSecretVarName)(env, componentName, exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX)];
41222
- return {
41223
- HOST_CANONICAL: HOST_CANONICAL
41224
- };
41225
- }
41226
- };
41227
- exports.GCLOUD_RUN_JOB_DEPLOY_TYPE = {
41228
- jobs: deployJob_1.createGoogleCloudRunDeployJobs,
41229
- defaults: function () {
41230
- return {};
41231
- },
41232
- additionalSecretKeys: function () {
41233
- return [exports.GCLOUD_DEPLOY_CREDENTIALS_KEY];
41234
- },
41235
- getAdditionalEnvVars: function (_a) {
41236
- var deployConfig = _a.deployConfig,
41237
- fullName = _a.fullName;
41238
-
41239
- if (!deployConfig) {
41240
- return {};
41241
- }
41299
+ var jobTriggers = deployConfig && deployConfig.jobs ? Object.fromEntries(Object.entries(deployConfig.jobs).map(function (_a) {
41300
+ var _b = __read(_a, 2),
41301
+ name = _b[0],
41302
+ job = _b[1];
41242
41303
 
41243
- var jobName = fullName.toLowerCase();
41244
- var CLOUD_RUN_JOB_TRIGGER_URL = "https://".concat(deployConfig.region, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(deployConfig.projectId, "/jobs/").concat(jobName, ":run");
41245
- return {
41246
- CLOUD_RUN_JOB_TRIGGER_URL: CLOUD_RUN_JOB_TRIGGER_URL
41247
- };
41304
+ return ["CLOUD_RUN_JOB_TRIGGER_URL_" + name, "https://".concat(deployConfig.region, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(deployConfig.projectId, "/jobs/").concat(name, ":run")];
41305
+ })) : {};
41306
+ return __assign({
41307
+ HOST_CANONICAL: HOST_CANONICAL
41308
+ }, jobTriggers);
41248
41309
  }
41249
41310
  };
41250
- exports.GCLOUD_RUN_DEPLOY_TYPES = {
41251
- "google-cloudrun": exports.GCLOUD_RUN_DEPLOY_TYPE,
41252
- "google-cloudrun-job": exports.GCLOUD_RUN_JOB_DEPLOY_TYPE
41253
- };
41254
41311
 
41255
41312
  /***/ }),
41256
41313
 
@@ -41485,20 +41542,6 @@ exports.DOCKER_TAG_DEPLOY_TYPE = {
41485
41542
  "use strict";
41486
41543
 
41487
41544
 
41488
- var __assign = this && this.__assign || function () {
41489
- __assign = Object.assign || function (t) {
41490
- for (var s, i = 1, n = arguments.length; i < n; i++) {
41491
- s = arguments[i];
41492
-
41493
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41494
- }
41495
-
41496
- return t;
41497
- };
41498
-
41499
- return __assign.apply(this, arguments);
41500
- };
41501
-
41502
41545
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
41503
41546
  if (k2 === undefined) k2 = k;
41504
41547
  Object.defineProperty(o, k2, {
@@ -41537,11 +41580,12 @@ __exportStar(__nccwpck_require__(3539), exports);
41537
41580
 
41538
41581
  __exportStar(__nccwpck_require__(1344), exports);
41539
41582
 
41540
- exports.DEPLOY_TYPES = __assign({
41583
+ exports.DEPLOY_TYPES = {
41541
41584
  kubernetes: kubernetes_1.KUBERNETES_DEPLOY_TYPE,
41542
41585
  custom: custom_1.CUSTOM_DEPLOY_TYPE,
41543
- dockerTag: dockerTag_1.DOCKER_TAG_DEPLOY_TYPE
41544
- }, cloudRun_1.GCLOUD_RUN_DEPLOY_TYPES);
41586
+ dockerTag: dockerTag_1.DOCKER_TAG_DEPLOY_TYPE,
41587
+ "google-cloudrun": cloudRun_1.GCLOUD_RUN_DEPLOY_TYPE
41588
+ };
41545
41589
 
41546
41590
  /***/ }),
41547
41591
 
@@ -350753,7 +350753,7 @@ exports.readConfigSync = readConfigSync;
350753
350753
 
350754
350754
  exports.__esModule = true;
350755
350755
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
350756
- exports.PIPELINE_IMAGE_TAG = "main-5bc1bdb9" || 0;
350756
+ exports.PIPELINE_IMAGE_TAG = "main-0009a81d" || 0;
350757
350757
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
350758
350758
 
350759
350759
  /***/ }),
@@ -351979,13 +351979,15 @@ var types_1 = __nccwpck_require__(63109);
351979
351979
  var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(22607);
351980
351980
 
351981
351981
  var createGoogleCloudRunDeployJobs = function (context) {
351982
+ var _a, _b;
351983
+
351982
351984
  var deployConfig = context.componentConfig.deploy;
351983
351985
 
351984
351986
  if (deployConfig === false) {
351985
351987
  return [];
351986
351988
  }
351987
351989
 
351988
- if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun", "google-cloudrun-job")) {
351990
+ if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
351989
351991
  // should not happen
351990
351992
  throw new Error("deploy config is wrong");
351991
351993
  }
@@ -352006,44 +352008,76 @@ var createGoogleCloudRunDeployJobs = function (context) {
352006
352008
  return "".concat(key, "=").concat(value);
352007
352009
  }).join(",");
352008
352010
  var commonArgs = "--project ".concat(deployConfig.projectId, " --region=").concat(deployConfig.region);
352011
+ var commonDeployArgs = "--image ".concat(gcloudImageName, " ").concat(commonArgs, " --labels ").concat(labelsString);
352012
+ var serviceName = context.environment.fullName.toLowerCase();
352009
352013
 
352010
- var getDeployCommand = function () {
352014
+ var getServiceDeployScript = function (service) {
352011
352015
  var _a;
352012
352016
 
352013
- var name = context.environment.fullName.toLowerCase();
352014
- var command = (_a = deployConfig.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand;
352017
+ var command = service !== true ? (_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand : undefined;
352015
352018
  var commandArg = command ? "--command=\"".concat(command.split(" ").join(","), "\"") : "";
352016
- var commonDeployArgs = "".concat(commandArg, " --image ").concat(gcloudImageName, " ").concat(commonArgs, " --env-vars-file=____envvars.yaml --labels ").concat(labelsString);
352019
+ return "gcloud run deploy ".concat(serviceName, " ").concat(commandArg, " ").concat(commonDeployArgs, " --env-vars-file=____envvars.yaml --allow-unauthenticated");
352020
+ };
352017
352021
 
352018
- if (deployConfig.type === "google-cloudrun") {
352019
- return "gcloud run deploy ".concat(name, " ").concat(commonDeployArgs, " --allow-unauthenticated");
352020
- }
352022
+ var getJobDeployScripts = function (jobName, job) {
352023
+ // due to some oversight from google, jobs create does not accept `--env-vars-file` 🤦
352024
+ // lucky, update on the other hand accepts it... so let's just imediatly update it
352025
+ // also we cannot upsert a job, so we have to create it and catch the error and then update
352026
+ var args = "".concat(jobName, " --command=\"").concat(job.command.split(" ").join(","), "\" ").concat(commonDeployArgs);
352027
+ return ["set +e", "gcloud beta run jobs create ".concat(args), "set -e", "gcloud beta run jobs update ".concat(args, " --env-vars-file=____envvars.yaml")];
352028
+ };
352021
352029
 
352022
- if (deployConfig.type === "google-cloudrun-job") {
352023
- return "gcloud beta run jobs create ".concat(name, " ").concat(commonDeployArgs);
352024
- }
352030
+ var getJobRunScript = function (jobName) {
352031
+ return "gcloud beta run jobs execute ".concat(jobName, " ").concat(commonArgs);
352025
352032
  };
352026
352033
 
352027
- var getStopCommand = function () {
352028
- var name = context.environment.fullName.toLowerCase();
352029
- var commonStopArgs = "".concat(commonArgs, " --quiet");
352034
+ var getFullJobName = function (name) {
352035
+ return context.environment.fullName.toLowerCase() + "-" + name;
352036
+ };
352030
352037
 
352031
- if (deployConfig.type === "google-cloudrun") {
352032
- return "gcloud run services delete ".concat(name, " ").concat(commonStopArgs);
352033
- }
352038
+ var jobsWithNames = Object.entries((_a = deployConfig.jobs) !== null && _a !== void 0 ? _a : {}).map(function (_a) {
352039
+ var _b = __read(_a, 2),
352040
+ name = _b[0],
352041
+ job = _b[1];
352034
352042
 
352035
- if (deployConfig.type === "google-cloudrun-job") {
352036
- return "gcloud beta run jobs delete ".concat(name, " ").concat(commonStopArgs);
352037
- }
352038
- };
352043
+ return [getFullJobName(name), job];
352044
+ });
352045
+
352046
+ var cloudRunDeployScripts = __spreadArray(__spreadArray(__spreadArray(__spreadArray(["echo \"$ENV_VARS\" > ____envvars.yaml"], __read(jobsWithNames.map(function (_a) {
352047
+ var _b = __read(_a, 2),
352048
+ name = _b[0],
352049
+ job = _b[1];
352050
+
352051
+ return getJobDeployScripts(name, job);
352052
+ }).flat()), false), __read(deployConfig.service !== false ? [getServiceDeployScript(deployConfig.service)] : []), false), __read(jobsWithNames.filter(function (_a) {
352053
+ var _b = __read(_a, 2),
352054
+ name = _b[0],
352055
+ job = _b[1];
352056
+
352057
+ return job.when === "postDeploy";
352058
+ }).map(function (_a) {
352059
+ var _b = __read(_a, 2),
352060
+ name = _b[0],
352061
+ job = _b[1];
352062
+
352063
+ return getJobRunScript(name);
352064
+ })), false), ["docker image rm ".concat(gcloudImageName)], false);
352065
+
352066
+ var cloudRunStopScripts = __spreadArray(__spreadArray([], __read(deployConfig.service !== false ? ["gcloud run services delete ".concat(serviceName)] : []), false), __read(Object.entries((_b = deployConfig.jobs) !== null && _b !== void 0 ? _b : {}).map(function (_a) {
352067
+ var _b = __read(_a, 2),
352068
+ jobName = _b[0],
352069
+ job = _b[1];
352070
+
352071
+ return "gcloud beta run jobs delete ".concat(jobName);
352072
+ })), false);
352039
352073
 
352040
- var cloudRunDeploy = ["echo \"$ENV_VARS\" > ____envvars.yaml", getDeployCommand(), "docker image rm ".concat(gcloudImageName)];
352041
352074
  var baseStopJob = (0, base_1.getBaseDeploymentStopJob)(context);
352042
352075
  return [(0, lodash_1.merge)({}, baseDeploymentJob, (0, docker_1.getDockerJobBaseProps)(context), {
352043
352076
  artifacts: {
352044
352077
  paths: ["____envvars.yaml"]
352045
352078
  },
352046
352079
  variables: {
352080
+ CLOUDSDK_CORE_DISABLE_PROMPTS: "1",
352047
352081
  ENV_VARS: (0, js_yaml_1.dump)(allEnvVars, {
352048
352082
  lineWidth: -1,
352049
352083
  quotingType: "'",
@@ -352051,10 +352085,13 @@ var createGoogleCloudRunDeployJobs = function (context) {
352051
352085
  })
352052
352086
  },
352053
352087
  image: (0, runner_1.getRunnerImage)("gcloud"),
352054
- script: __spreadArray(__spreadArray([], __read(pushImageToArtifactsRegistry), false), __read(cloudRunDeploy), false)
352088
+ script: __spreadArray(__spreadArray([], __read(pushImageToArtifactsRegistry), false), __read(cloudRunDeployScripts), false)
352055
352089
  }), (0, lodash_1.merge)({}, baseStopJob, {
352056
352090
  image: (0, runner_1.getRunnerImage)("gcloud"),
352057
- script: __spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), [getStopCommand()], false)
352091
+ variables: {
352092
+ CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
352093
+ },
352094
+ script: __spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read(cloudRunStopScripts), false)
352058
352095
  })];
352059
352096
  };
352060
352097
 
@@ -352063,13 +352100,52 @@ exports.createGoogleCloudRunDeployJobs = createGoogleCloudRunDeployJobs;
352063
352100
  /***/ }),
352064
352101
 
352065
352102
  /***/ 81344:
352066
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
352103
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
352067
352104
 
352068
352105
  "use strict";
352069
352106
 
352070
352107
 
352108
+ var __assign = this && this.__assign || function () {
352109
+ __assign = Object.assign || function (t) {
352110
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
352111
+ s = arguments[i];
352112
+
352113
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
352114
+ }
352115
+
352116
+ return t;
352117
+ };
352118
+
352119
+ return __assign.apply(this, arguments);
352120
+ };
352121
+
352122
+ var __read = this && this.__read || function (o, n) {
352123
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
352124
+ if (!m) return o;
352125
+ var i = m.call(o),
352126
+ r,
352127
+ ar = [],
352128
+ e;
352129
+
352130
+ try {
352131
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
352132
+ } catch (error) {
352133
+ e = {
352134
+ error: error
352135
+ };
352136
+ } finally {
352137
+ try {
352138
+ if (r && !r.done && (m = i["return"])) m.call(i);
352139
+ } finally {
352140
+ if (e) throw e.error;
352141
+ }
352142
+ }
352143
+
352144
+ return ar;
352145
+ };
352146
+
352071
352147
  exports.__esModule = true;
352072
- exports.GCLOUD_RUN_DEPLOY_TYPES = exports.GCLOUD_RUN_JOB_DEPLOY_TYPE = exports.GCLOUD_RUN_DEPLOY_TYPE = exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = void 0;
352148
+ exports.GCLOUD_RUN_DEPLOY_TYPE = exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = void 0;
352073
352149
 
352074
352150
  var context_1 = __nccwpck_require__(22041);
352075
352151
 
@@ -352088,40 +352164,21 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
352088
352164
  getAdditionalEnvVars: function (_a) {
352089
352165
  var fullName = _a.fullName,
352090
352166
  env = _a.env,
352091
- componentName = _a.componentName;
352167
+ componentName = _a.componentName,
352168
+ deployConfig = _a.deployConfig;
352092
352169
  var HOST_CANONICAL = fullName.toLowerCase() + "-" + process.env[(0, context_1.getSecretVarName)(env, componentName, exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX)];
352093
- return {
352094
- HOST_CANONICAL: HOST_CANONICAL
352095
- };
352096
- }
352097
- };
352098
- exports.GCLOUD_RUN_JOB_DEPLOY_TYPE = {
352099
- jobs: deployJob_1.createGoogleCloudRunDeployJobs,
352100
- defaults: function () {
352101
- return {};
352102
- },
352103
- additionalSecretKeys: function () {
352104
- return [exports.GCLOUD_DEPLOY_CREDENTIALS_KEY];
352105
- },
352106
- getAdditionalEnvVars: function (_a) {
352107
- var deployConfig = _a.deployConfig,
352108
- fullName = _a.fullName;
352109
-
352110
- if (!deployConfig) {
352111
- return {};
352112
- }
352170
+ var jobTriggers = deployConfig && deployConfig.jobs ? Object.fromEntries(Object.entries(deployConfig.jobs).map(function (_a) {
352171
+ var _b = __read(_a, 2),
352172
+ name = _b[0],
352173
+ job = _b[1];
352113
352174
 
352114
- var jobName = fullName.toLowerCase();
352115
- var CLOUD_RUN_JOB_TRIGGER_URL = "https://".concat(deployConfig.region, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(deployConfig.projectId, "/jobs/").concat(jobName, ":run");
352116
- return {
352117
- CLOUD_RUN_JOB_TRIGGER_URL: CLOUD_RUN_JOB_TRIGGER_URL
352118
- };
352175
+ return ["CLOUD_RUN_JOB_TRIGGER_URL_" + name, "https://".concat(deployConfig.region, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(deployConfig.projectId, "/jobs/").concat(name, ":run")];
352176
+ })) : {};
352177
+ return __assign({
352178
+ HOST_CANONICAL: HOST_CANONICAL
352179
+ }, jobTriggers);
352119
352180
  }
352120
352181
  };
352121
- exports.GCLOUD_RUN_DEPLOY_TYPES = {
352122
- "google-cloudrun": exports.GCLOUD_RUN_DEPLOY_TYPE,
352123
- "google-cloudrun-job": exports.GCLOUD_RUN_JOB_DEPLOY_TYPE
352124
- };
352125
352182
 
352126
352183
  /***/ }),
352127
352184
 
@@ -352356,20 +352413,6 @@ exports.DOCKER_TAG_DEPLOY_TYPE = {
352356
352413
  "use strict";
352357
352414
 
352358
352415
 
352359
- var __assign = this && this.__assign || function () {
352360
- __assign = Object.assign || function (t) {
352361
- for (var s, i = 1, n = arguments.length; i < n; i++) {
352362
- s = arguments[i];
352363
-
352364
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
352365
- }
352366
-
352367
- return t;
352368
- };
352369
-
352370
- return __assign.apply(this, arguments);
352371
- };
352372
-
352373
352416
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
352374
352417
  if (k2 === undefined) k2 = k;
352375
352418
  Object.defineProperty(o, k2, {
@@ -352408,11 +352451,12 @@ __exportStar(__nccwpck_require__(13539), exports);
352408
352451
 
352409
352452
  __exportStar(__nccwpck_require__(81344), exports);
352410
352453
 
352411
- exports.DEPLOY_TYPES = __assign({
352454
+ exports.DEPLOY_TYPES = {
352412
352455
  kubernetes: kubernetes_1.KUBERNETES_DEPLOY_TYPE,
352413
352456
  custom: custom_1.CUSTOM_DEPLOY_TYPE,
352414
- dockerTag: dockerTag_1.DOCKER_TAG_DEPLOY_TYPE
352415
- }, cloudRun_1.GCLOUD_RUN_DEPLOY_TYPES);
352457
+ dockerTag: dockerTag_1.DOCKER_TAG_DEPLOY_TYPE,
352458
+ "google-cloudrun": cloudRun_1.GCLOUD_RUN_DEPLOY_TYPE
352459
+ };
352416
352460
 
352417
352461
  /***/ }),
352418
352462