@catladder/cli 0.0.0-refactor-env-context-76787e25 → 0.0.0-refactor-env-context-834a2b56

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 = "refactor-env-context-76787e25" || 0;
39885
+ exports.PIPELINE_IMAGE_TAG = "refactor-env-context-834a2b56" || 0;
39886
39886
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
39887
39887
 
39888
39888
  /***/ }),
@@ -41354,13 +41354,15 @@ var types_1 = __nccwpck_require__(3109);
41354
41354
  var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(2607);
41355
41355
 
41356
41356
  var createGoogleCloudRunDeployJobs = function (context) {
41357
+ var _a, _b;
41358
+
41357
41359
  var deployConfig = context.componentConfig.deploy;
41358
41360
 
41359
41361
  if (deployConfig === false) {
41360
41362
  return [];
41361
41363
  }
41362
41364
 
41363
- if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun", "google-cloudrun-job")) {
41365
+ if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
41364
41366
  // should not happen
41365
41367
  throw new Error("deploy config is wrong");
41366
41368
  }
@@ -41381,44 +41383,76 @@ var createGoogleCloudRunDeployJobs = function (context) {
41381
41383
  return "".concat(key, "=").concat(value);
41382
41384
  }).join(",");
41383
41385
  var commonArgs = "--project ".concat(deployConfig.projectId, " --region=").concat(deployConfig.region);
41386
+ var commonDeployArgs = "--image ".concat(gcloudImageName, " ").concat(commonArgs, " --labels ").concat(labelsString);
41387
+ var serviceName = context.environment.fullName.toLowerCase();
41384
41388
 
41385
- var getDeployCommand = function () {
41389
+ var getServiceDeployScript = function (service) {
41386
41390
  var _a;
41387
41391
 
41388
- var name = context.environment.fullName.toLowerCase();
41389
- var command = (_a = deployConfig.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand;
41392
+ var command = service !== true ? (_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand : undefined;
41390
41393
  var commandArg = command ? "--command=\"".concat(command.split(" ").join(","), "\"") : "";
41391
- var commonDeployArgs = "".concat(commandArg, " --image ").concat(gcloudImageName, " ").concat(commonArgs, " --env-vars-file=____envvars.yaml --labels ").concat(labelsString);
41394
+ return "gcloud run deploy ".concat(serviceName, " ").concat(commandArg, " ").concat(commonDeployArgs, " --env-vars-file=____envvars.yaml --allow-unauthenticated");
41395
+ };
41392
41396
 
41393
- if (deployConfig.type === "google-cloudrun") {
41394
- return "gcloud run deploy ".concat(name, " ").concat(commonDeployArgs, " --allow-unauthenticated");
41395
- }
41397
+ var getJobDeployScripts = function (jobName, job) {
41398
+ // due to some oversight from google, jobs create does not accept `--env-vars-file` 🤦
41399
+ // lucky, update on the other hand accepts it... so let's just imediatly update it
41400
+ // also we cannot upsert a job, so we have to create it and catch the error and then update
41401
+ var args = "".concat(jobName, " --command=\"").concat(job.command.split(" ").join(","), "\" ").concat(commonDeployArgs);
41402
+ return ["set +e", "gcloud beta run jobs create ".concat(args), "set -e", "gcloud beta run jobs update ".concat(args, " --env-vars-file=____envvars.yaml")];
41403
+ };
41396
41404
 
41397
- if (deployConfig.type === "google-cloudrun-job") {
41398
- return "gcloud beta run jobs create ".concat(name, " ").concat(commonDeployArgs);
41399
- }
41405
+ var getJobRunScript = function (jobName) {
41406
+ return "gcloud beta run jobs execute ".concat(jobName, " ").concat(commonArgs);
41400
41407
  };
41401
41408
 
41402
- var getStopCommand = function () {
41403
- var name = context.environment.fullName.toLowerCase();
41404
- var commonStopArgs = "".concat(commonArgs, " --quiet");
41409
+ var getFullJobName = function (name) {
41410
+ return context.environment.fullName.toLowerCase() + "-" + name;
41411
+ };
41405
41412
 
41406
- if (deployConfig.type === "google-cloudrun") {
41407
- return "gcloud run services delete ".concat(name, " ").concat(commonStopArgs);
41408
- }
41413
+ var jobsWithNames = Object.entries((_a = deployConfig.jobs) !== null && _a !== void 0 ? _a : {}).map(function (_a) {
41414
+ var _b = __read(_a, 2),
41415
+ name = _b[0],
41416
+ job = _b[1];
41409
41417
 
41410
- if (deployConfig.type === "google-cloudrun-job") {
41411
- return "gcloud beta run jobs delete ".concat(name, " ").concat(commonStopArgs);
41412
- }
41413
- };
41418
+ return [getFullJobName(name), job];
41419
+ });
41420
+
41421
+ var cloudRunDeployScripts = __spreadArray(__spreadArray(__spreadArray(__spreadArray(["echo \"$ENV_VARS\" > ____envvars.yaml"], __read(jobsWithNames.map(function (_a) {
41422
+ var _b = __read(_a, 2),
41423
+ name = _b[0],
41424
+ job = _b[1];
41425
+
41426
+ return getJobDeployScripts(name, job);
41427
+ }).flat()), false), __read(deployConfig.service !== false ? [getServiceDeployScript(deployConfig.service)] : []), false), __read(jobsWithNames.filter(function (_a) {
41428
+ var _b = __read(_a, 2),
41429
+ name = _b[0],
41430
+ job = _b[1];
41431
+
41432
+ return job.when === "postDeploy";
41433
+ }).map(function (_a) {
41434
+ var _b = __read(_a, 2),
41435
+ name = _b[0],
41436
+ job = _b[1];
41437
+
41438
+ return getJobRunScript(name);
41439
+ })), false), ["docker image rm ".concat(gcloudImageName)], false);
41440
+
41441
+ 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) {
41442
+ var _b = __read(_a, 2),
41443
+ jobName = _b[0],
41444
+ job = _b[1];
41445
+
41446
+ return "gcloud beta run jobs delete ".concat(jobName);
41447
+ })), false);
41414
41448
 
41415
- var cloudRunDeploy = ["echo \"$ENV_VARS\" > ____envvars.yaml", getDeployCommand(), "docker image rm ".concat(gcloudImageName)];
41416
41449
  var baseStopJob = (0, base_1.getBaseDeploymentStopJob)(context);
41417
41450
  return [(0, lodash_1.merge)({}, baseDeploymentJob, (0, docker_1.getDockerJobBaseProps)(context), {
41418
41451
  artifacts: {
41419
41452
  paths: ["____envvars.yaml"]
41420
41453
  },
41421
41454
  variables: {
41455
+ CLOUDSDK_CORE_DISABLE_PROMPTS: "1",
41422
41456
  ENV_VARS: (0, js_yaml_1.dump)(allEnvVars, {
41423
41457
  lineWidth: -1,
41424
41458
  quotingType: "'",
@@ -41426,10 +41460,13 @@ var createGoogleCloudRunDeployJobs = function (context) {
41426
41460
  })
41427
41461
  },
41428
41462
  image: (0, runner_1.getRunnerImage)("gcloud"),
41429
- script: __spreadArray(__spreadArray([], __read(pushImageToArtifactsRegistry), false), __read(cloudRunDeploy), false)
41463
+ script: __spreadArray(__spreadArray([], __read(pushImageToArtifactsRegistry), false), __read(cloudRunDeployScripts), false)
41430
41464
  }), (0, lodash_1.merge)({}, baseStopJob, {
41431
41465
  image: (0, runner_1.getRunnerImage)("gcloud"),
41432
- script: __spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), [getStopCommand()], false)
41466
+ variables: {
41467
+ CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
41468
+ },
41469
+ script: __spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read(cloudRunStopScripts), false)
41433
41470
  })];
41434
41471
  };
41435
41472
 
@@ -41438,13 +41475,52 @@ exports.createGoogleCloudRunDeployJobs = createGoogleCloudRunDeployJobs;
41438
41475
  /***/ }),
41439
41476
 
41440
41477
  /***/ 1344:
41441
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
41478
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
41442
41479
 
41443
41480
  "use strict";
41444
41481
 
41445
41482
 
41483
+ var __assign = this && this.__assign || function () {
41484
+ __assign = Object.assign || function (t) {
41485
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
41486
+ s = arguments[i];
41487
+
41488
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41489
+ }
41490
+
41491
+ return t;
41492
+ };
41493
+
41494
+ return __assign.apply(this, arguments);
41495
+ };
41496
+
41497
+ var __read = this && this.__read || function (o, n) {
41498
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
41499
+ if (!m) return o;
41500
+ var i = m.call(o),
41501
+ r,
41502
+ ar = [],
41503
+ e;
41504
+
41505
+ try {
41506
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
41507
+ } catch (error) {
41508
+ e = {
41509
+ error: error
41510
+ };
41511
+ } finally {
41512
+ try {
41513
+ if (r && !r.done && (m = i["return"])) m.call(i);
41514
+ } finally {
41515
+ if (e) throw e.error;
41516
+ }
41517
+ }
41518
+
41519
+ return ar;
41520
+ };
41521
+
41446
41522
  exports.__esModule = true;
41447
- 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;
41523
+ exports.GCLOUD_RUN_DEPLOY_TYPE = exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = void 0;
41448
41524
 
41449
41525
  var context_1 = __nccwpck_require__(2041);
41450
41526
 
@@ -41463,40 +41539,21 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
41463
41539
  getAdditionalEnvVars: function (_a) {
41464
41540
  var fullName = _a.fullName,
41465
41541
  env = _a.env,
41466
- componentName = _a.componentName;
41542
+ componentName = _a.componentName,
41543
+ deployConfigRaw = _a.deployConfigRaw;
41467
41544
  var HOST_CANONICAL = fullName.toLowerCase() + "-" + process.env[(0, context_1.getSecretVarName)(env, componentName, exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX)];
41468
- return {
41469
- HOST_CANONICAL: HOST_CANONICAL
41470
- };
41471
- }
41472
- };
41473
- exports.GCLOUD_RUN_JOB_DEPLOY_TYPE = {
41474
- jobs: deployJob_1.createGoogleCloudRunDeployJobs,
41475
- defaults: function () {
41476
- return {};
41477
- },
41478
- additionalSecretKeys: function () {
41479
- return [exports.GCLOUD_DEPLOY_CREDENTIALS_KEY];
41480
- },
41481
- getAdditionalEnvVars: function (_a) {
41482
- var deployConfigRaw = _a.deployConfigRaw,
41483
- fullName = _a.fullName;
41484
-
41485
- if (!deployConfigRaw) {
41486
- return {};
41487
- }
41545
+ var jobTriggers = deployConfigRaw && deployConfigRaw.jobs ? Object.fromEntries(Object.entries(deployConfigRaw.jobs).map(function (_a) {
41546
+ var _b = __read(_a, 2),
41547
+ name = _b[0],
41548
+ job = _b[1];
41488
41549
 
41489
- var jobName = fullName.toLowerCase();
41490
- var CLOUD_RUN_JOB_TRIGGER_URL = "https://".concat(deployConfigRaw.region, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(deployConfigRaw.projectId, "/jobs/").concat(jobName, ":run");
41491
- return {
41492
- CLOUD_RUN_JOB_TRIGGER_URL: CLOUD_RUN_JOB_TRIGGER_URL
41493
- };
41550
+ return ["CLOUD_RUN_JOB_TRIGGER_URL_" + name, "https://".concat(deployConfigRaw.region, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(deployConfigRaw.projectId, "/jobs/").concat(name, ":run")];
41551
+ })) : {};
41552
+ return __assign({
41553
+ HOST_CANONICAL: HOST_CANONICAL
41554
+ }, jobTriggers);
41494
41555
  }
41495
41556
  };
41496
- exports.GCLOUD_RUN_DEPLOY_TYPES = {
41497
- "google-cloudrun": exports.GCLOUD_RUN_DEPLOY_TYPE,
41498
- "google-cloudrun-job": exports.GCLOUD_RUN_JOB_DEPLOY_TYPE
41499
- };
41500
41557
 
41501
41558
  /***/ }),
41502
41559
 
@@ -41731,20 +41788,6 @@ exports.DOCKER_TAG_DEPLOY_TYPE = {
41731
41788
  "use strict";
41732
41789
 
41733
41790
 
41734
- var __assign = this && this.__assign || function () {
41735
- __assign = Object.assign || function (t) {
41736
- for (var s, i = 1, n = arguments.length; i < n; i++) {
41737
- s = arguments[i];
41738
-
41739
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41740
- }
41741
-
41742
- return t;
41743
- };
41744
-
41745
- return __assign.apply(this, arguments);
41746
- };
41747
-
41748
41791
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
41749
41792
  if (k2 === undefined) k2 = k;
41750
41793
  Object.defineProperty(o, k2, {
@@ -41783,11 +41826,12 @@ __exportStar(__nccwpck_require__(3109), exports);
41783
41826
 
41784
41827
  __exportStar(__nccwpck_require__(2757), exports);
41785
41828
 
41786
- exports.DEPLOY_TYPES = __assign({
41829
+ exports.DEPLOY_TYPES = {
41787
41830
  kubernetes: kubernetes_1.KUBERNETES_DEPLOY_TYPE,
41788
41831
  custom: custom_1.CUSTOM_DEPLOY_TYPE,
41789
- dockerTag: dockerTag_1.DOCKER_TAG_DEPLOY_TYPE
41790
- }, cloudRun_1.GCLOUD_RUN_DEPLOY_TYPES);
41832
+ dockerTag: dockerTag_1.DOCKER_TAG_DEPLOY_TYPE,
41833
+ "google-cloudrun": cloudRun_1.GCLOUD_RUN_DEPLOY_TYPE
41834
+ };
41791
41835
 
41792
41836
  /***/ }),
41793
41837
 
@@ -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 = "refactor-env-context-76787e25" || 0;
350756
+ exports.PIPELINE_IMAGE_TAG = "refactor-env-context-834a2b56" || 0;
350757
350757
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
350758
350758
 
350759
350759
  /***/ }),
@@ -352225,13 +352225,15 @@ var types_1 = __nccwpck_require__(63109);
352225
352225
  var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(22607);
352226
352226
 
352227
352227
  var createGoogleCloudRunDeployJobs = function (context) {
352228
+ var _a, _b;
352229
+
352228
352230
  var deployConfig = context.componentConfig.deploy;
352229
352231
 
352230
352232
  if (deployConfig === false) {
352231
352233
  return [];
352232
352234
  }
352233
352235
 
352234
- if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun", "google-cloudrun-job")) {
352236
+ if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
352235
352237
  // should not happen
352236
352238
  throw new Error("deploy config is wrong");
352237
352239
  }
@@ -352252,44 +352254,76 @@ var createGoogleCloudRunDeployJobs = function (context) {
352252
352254
  return "".concat(key, "=").concat(value);
352253
352255
  }).join(",");
352254
352256
  var commonArgs = "--project ".concat(deployConfig.projectId, " --region=").concat(deployConfig.region);
352257
+ var commonDeployArgs = "--image ".concat(gcloudImageName, " ").concat(commonArgs, " --labels ").concat(labelsString);
352258
+ var serviceName = context.environment.fullName.toLowerCase();
352255
352259
 
352256
- var getDeployCommand = function () {
352260
+ var getServiceDeployScript = function (service) {
352257
352261
  var _a;
352258
352262
 
352259
- var name = context.environment.fullName.toLowerCase();
352260
- var command = (_a = deployConfig.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand;
352263
+ var command = service !== true ? (_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand : undefined;
352261
352264
  var commandArg = command ? "--command=\"".concat(command.split(" ").join(","), "\"") : "";
352262
- var commonDeployArgs = "".concat(commandArg, " --image ").concat(gcloudImageName, " ").concat(commonArgs, " --env-vars-file=____envvars.yaml --labels ").concat(labelsString);
352265
+ return "gcloud run deploy ".concat(serviceName, " ").concat(commandArg, " ").concat(commonDeployArgs, " --env-vars-file=____envvars.yaml --allow-unauthenticated");
352266
+ };
352263
352267
 
352264
- if (deployConfig.type === "google-cloudrun") {
352265
- return "gcloud run deploy ".concat(name, " ").concat(commonDeployArgs, " --allow-unauthenticated");
352266
- }
352268
+ var getJobDeployScripts = function (jobName, job) {
352269
+ // due to some oversight from google, jobs create does not accept `--env-vars-file` 🤦
352270
+ // lucky, update on the other hand accepts it... so let's just imediatly update it
352271
+ // also we cannot upsert a job, so we have to create it and catch the error and then update
352272
+ var args = "".concat(jobName, " --command=\"").concat(job.command.split(" ").join(","), "\" ").concat(commonDeployArgs);
352273
+ return ["set +e", "gcloud beta run jobs create ".concat(args), "set -e", "gcloud beta run jobs update ".concat(args, " --env-vars-file=____envvars.yaml")];
352274
+ };
352267
352275
 
352268
- if (deployConfig.type === "google-cloudrun-job") {
352269
- return "gcloud beta run jobs create ".concat(name, " ").concat(commonDeployArgs);
352270
- }
352276
+ var getJobRunScript = function (jobName) {
352277
+ return "gcloud beta run jobs execute ".concat(jobName, " ").concat(commonArgs);
352271
352278
  };
352272
352279
 
352273
- var getStopCommand = function () {
352274
- var name = context.environment.fullName.toLowerCase();
352275
- var commonStopArgs = "".concat(commonArgs, " --quiet");
352280
+ var getFullJobName = function (name) {
352281
+ return context.environment.fullName.toLowerCase() + "-" + name;
352282
+ };
352276
352283
 
352277
- if (deployConfig.type === "google-cloudrun") {
352278
- return "gcloud run services delete ".concat(name, " ").concat(commonStopArgs);
352279
- }
352284
+ var jobsWithNames = Object.entries((_a = deployConfig.jobs) !== null && _a !== void 0 ? _a : {}).map(function (_a) {
352285
+ var _b = __read(_a, 2),
352286
+ name = _b[0],
352287
+ job = _b[1];
352280
352288
 
352281
- if (deployConfig.type === "google-cloudrun-job") {
352282
- return "gcloud beta run jobs delete ".concat(name, " ").concat(commonStopArgs);
352283
- }
352284
- };
352289
+ return [getFullJobName(name), job];
352290
+ });
352291
+
352292
+ var cloudRunDeployScripts = __spreadArray(__spreadArray(__spreadArray(__spreadArray(["echo \"$ENV_VARS\" > ____envvars.yaml"], __read(jobsWithNames.map(function (_a) {
352293
+ var _b = __read(_a, 2),
352294
+ name = _b[0],
352295
+ job = _b[1];
352296
+
352297
+ return getJobDeployScripts(name, job);
352298
+ }).flat()), false), __read(deployConfig.service !== false ? [getServiceDeployScript(deployConfig.service)] : []), false), __read(jobsWithNames.filter(function (_a) {
352299
+ var _b = __read(_a, 2),
352300
+ name = _b[0],
352301
+ job = _b[1];
352302
+
352303
+ return job.when === "postDeploy";
352304
+ }).map(function (_a) {
352305
+ var _b = __read(_a, 2),
352306
+ name = _b[0],
352307
+ job = _b[1];
352308
+
352309
+ return getJobRunScript(name);
352310
+ })), false), ["docker image rm ".concat(gcloudImageName)], false);
352311
+
352312
+ 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) {
352313
+ var _b = __read(_a, 2),
352314
+ jobName = _b[0],
352315
+ job = _b[1];
352316
+
352317
+ return "gcloud beta run jobs delete ".concat(jobName);
352318
+ })), false);
352285
352319
 
352286
- var cloudRunDeploy = ["echo \"$ENV_VARS\" > ____envvars.yaml", getDeployCommand(), "docker image rm ".concat(gcloudImageName)];
352287
352320
  var baseStopJob = (0, base_1.getBaseDeploymentStopJob)(context);
352288
352321
  return [(0, lodash_1.merge)({}, baseDeploymentJob, (0, docker_1.getDockerJobBaseProps)(context), {
352289
352322
  artifacts: {
352290
352323
  paths: ["____envvars.yaml"]
352291
352324
  },
352292
352325
  variables: {
352326
+ CLOUDSDK_CORE_DISABLE_PROMPTS: "1",
352293
352327
  ENV_VARS: (0, js_yaml_1.dump)(allEnvVars, {
352294
352328
  lineWidth: -1,
352295
352329
  quotingType: "'",
@@ -352297,10 +352331,13 @@ var createGoogleCloudRunDeployJobs = function (context) {
352297
352331
  })
352298
352332
  },
352299
352333
  image: (0, runner_1.getRunnerImage)("gcloud"),
352300
- script: __spreadArray(__spreadArray([], __read(pushImageToArtifactsRegistry), false), __read(cloudRunDeploy), false)
352334
+ script: __spreadArray(__spreadArray([], __read(pushImageToArtifactsRegistry), false), __read(cloudRunDeployScripts), false)
352301
352335
  }), (0, lodash_1.merge)({}, baseStopJob, {
352302
352336
  image: (0, runner_1.getRunnerImage)("gcloud"),
352303
- script: __spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), [getStopCommand()], false)
352337
+ variables: {
352338
+ CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
352339
+ },
352340
+ script: __spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read(cloudRunStopScripts), false)
352304
352341
  })];
352305
352342
  };
352306
352343
 
@@ -352309,13 +352346,52 @@ exports.createGoogleCloudRunDeployJobs = createGoogleCloudRunDeployJobs;
352309
352346
  /***/ }),
352310
352347
 
352311
352348
  /***/ 81344:
352312
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
352349
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
352313
352350
 
352314
352351
  "use strict";
352315
352352
 
352316
352353
 
352354
+ var __assign = this && this.__assign || function () {
352355
+ __assign = Object.assign || function (t) {
352356
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
352357
+ s = arguments[i];
352358
+
352359
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
352360
+ }
352361
+
352362
+ return t;
352363
+ };
352364
+
352365
+ return __assign.apply(this, arguments);
352366
+ };
352367
+
352368
+ var __read = this && this.__read || function (o, n) {
352369
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
352370
+ if (!m) return o;
352371
+ var i = m.call(o),
352372
+ r,
352373
+ ar = [],
352374
+ e;
352375
+
352376
+ try {
352377
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
352378
+ } catch (error) {
352379
+ e = {
352380
+ error: error
352381
+ };
352382
+ } finally {
352383
+ try {
352384
+ if (r && !r.done && (m = i["return"])) m.call(i);
352385
+ } finally {
352386
+ if (e) throw e.error;
352387
+ }
352388
+ }
352389
+
352390
+ return ar;
352391
+ };
352392
+
352317
352393
  exports.__esModule = true;
352318
- 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;
352394
+ exports.GCLOUD_RUN_DEPLOY_TYPE = exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = void 0;
352319
352395
 
352320
352396
  var context_1 = __nccwpck_require__(22041);
352321
352397
 
@@ -352334,40 +352410,21 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
352334
352410
  getAdditionalEnvVars: function (_a) {
352335
352411
  var fullName = _a.fullName,
352336
352412
  env = _a.env,
352337
- componentName = _a.componentName;
352413
+ componentName = _a.componentName,
352414
+ deployConfigRaw = _a.deployConfigRaw;
352338
352415
  var HOST_CANONICAL = fullName.toLowerCase() + "-" + process.env[(0, context_1.getSecretVarName)(env, componentName, exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX)];
352339
- return {
352340
- HOST_CANONICAL: HOST_CANONICAL
352341
- };
352342
- }
352343
- };
352344
- exports.GCLOUD_RUN_JOB_DEPLOY_TYPE = {
352345
- jobs: deployJob_1.createGoogleCloudRunDeployJobs,
352346
- defaults: function () {
352347
- return {};
352348
- },
352349
- additionalSecretKeys: function () {
352350
- return [exports.GCLOUD_DEPLOY_CREDENTIALS_KEY];
352351
- },
352352
- getAdditionalEnvVars: function (_a) {
352353
- var deployConfigRaw = _a.deployConfigRaw,
352354
- fullName = _a.fullName;
352355
-
352356
- if (!deployConfigRaw) {
352357
- return {};
352358
- }
352416
+ var jobTriggers = deployConfigRaw && deployConfigRaw.jobs ? Object.fromEntries(Object.entries(deployConfigRaw.jobs).map(function (_a) {
352417
+ var _b = __read(_a, 2),
352418
+ name = _b[0],
352419
+ job = _b[1];
352359
352420
 
352360
- var jobName = fullName.toLowerCase();
352361
- var CLOUD_RUN_JOB_TRIGGER_URL = "https://".concat(deployConfigRaw.region, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(deployConfigRaw.projectId, "/jobs/").concat(jobName, ":run");
352362
- return {
352363
- CLOUD_RUN_JOB_TRIGGER_URL: CLOUD_RUN_JOB_TRIGGER_URL
352364
- };
352421
+ return ["CLOUD_RUN_JOB_TRIGGER_URL_" + name, "https://".concat(deployConfigRaw.region, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(deployConfigRaw.projectId, "/jobs/").concat(name, ":run")];
352422
+ })) : {};
352423
+ return __assign({
352424
+ HOST_CANONICAL: HOST_CANONICAL
352425
+ }, jobTriggers);
352365
352426
  }
352366
352427
  };
352367
- exports.GCLOUD_RUN_DEPLOY_TYPES = {
352368
- "google-cloudrun": exports.GCLOUD_RUN_DEPLOY_TYPE,
352369
- "google-cloudrun-job": exports.GCLOUD_RUN_JOB_DEPLOY_TYPE
352370
- };
352371
352428
 
352372
352429
  /***/ }),
352373
352430
 
@@ -352602,20 +352659,6 @@ exports.DOCKER_TAG_DEPLOY_TYPE = {
352602
352659
  "use strict";
352603
352660
 
352604
352661
 
352605
- var __assign = this && this.__assign || function () {
352606
- __assign = Object.assign || function (t) {
352607
- for (var s, i = 1, n = arguments.length; i < n; i++) {
352608
- s = arguments[i];
352609
-
352610
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
352611
- }
352612
-
352613
- return t;
352614
- };
352615
-
352616
- return __assign.apply(this, arguments);
352617
- };
352618
-
352619
352662
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
352620
352663
  if (k2 === undefined) k2 = k;
352621
352664
  Object.defineProperty(o, k2, {
@@ -352654,11 +352697,12 @@ __exportStar(__nccwpck_require__(63109), exports);
352654
352697
 
352655
352698
  __exportStar(__nccwpck_require__(92757), exports);
352656
352699
 
352657
- exports.DEPLOY_TYPES = __assign({
352700
+ exports.DEPLOY_TYPES = {
352658
352701
  kubernetes: kubernetes_1.KUBERNETES_DEPLOY_TYPE,
352659
352702
  custom: custom_1.CUSTOM_DEPLOY_TYPE,
352660
- dockerTag: dockerTag_1.DOCKER_TAG_DEPLOY_TYPE
352661
- }, cloudRun_1.GCLOUD_RUN_DEPLOY_TYPES);
352703
+ dockerTag: dockerTag_1.DOCKER_TAG_DEPLOY_TYPE,
352704
+ "google-cloudrun": cloudRun_1.GCLOUD_RUN_DEPLOY_TYPE
352705
+ };
352662
352706
 
352663
352707
  /***/ }),
352664
352708