@catladder/cli 0.0.0-main-332b079a → 0.0.0-main-752fde5b

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.
@@ -40059,7 +40059,7 @@ exports.readConfigSync = readConfigSync;
40059
40059
 
40060
40060
  exports.__esModule = true;
40061
40061
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
40062
- exports.PIPELINE_IMAGE_TAG = "main-332b079a" || 0;
40062
+ exports.PIPELINE_IMAGE_TAG = "main-752fde5b" || 0;
40063
40063
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
40064
40064
 
40065
40065
  /***/ }),
@@ -41530,10 +41530,12 @@ var types_1 = __nccwpck_require__(3109);
41530
41530
 
41531
41531
  var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(2607);
41532
41532
 
41533
+ var database_1 = __nccwpck_require__(1384);
41534
+
41533
41535
  var gitlab_1 = __nccwpck_require__(4997);
41534
41536
 
41535
41537
  var createGoogleCloudRunDeployJobs = function (context) {
41536
- var _a, _b;
41538
+ var _a;
41537
41539
 
41538
41540
  var deployConfig = context.componentConfig.deploy;
41539
41541
 
@@ -41562,7 +41564,8 @@ var createGoogleCloudRunDeployJobs = function (context) {
41562
41564
  return "".concat(key, "=").concat(value);
41563
41565
  }).join(",");
41564
41566
  var commonArgs = "--project ".concat(deployConfig.projectId, " --region=").concat(deployConfig.region);
41565
- var commonDeployArgs = "--image ".concat(gcloudImageName, " ").concat(commonArgs, " --labels ").concat(labelsString);
41567
+ var cloudRunArgs = deployConfig.cloudSql ? "--set-cloudsql-instances=".concat(deployConfig.cloudSql.instanceConnectionName) : "";
41568
+ var commonDeployArgs = "--image ".concat(gcloudImageName, " ").concat(commonArgs, " ").concat(cloudRunArgs, " --labels ").concat(labelsString);
41566
41569
  var serviceName = context.environment.fullName.toLowerCase();
41567
41570
 
41568
41571
  var getServiceDeployScript = function (service) {
@@ -41577,7 +41580,7 @@ var createGoogleCloudRunDeployJobs = function (context) {
41577
41580
  // due to some oversight from google, jobs create does not accept `--env-vars-file` 🤦
41578
41581
  // lucky, update on the other hand accepts it... so let's just imediatly update it
41579
41582
  // also we cannot upsert a job, so we have to create it and catch the error and then update
41580
- var args = "".concat(jobName, " --command=\"").concat(job.command.split(" ").join(","), "\" ").concat(commonDeployArgs);
41583
+ var args = "".concat(jobName, " --command=\"").concat(job.command.split(" ").join(","), "\" ").concat(commonDeployArgs, " --memory=").concat(job.memory || "512Mi");
41581
41584
  return __spreadArray(__spreadArray([], __read((0, gitlab_1.allowFailureInScripts)(["gcloud beta run jobs create ".concat(args)])), false), ["gcloud beta run jobs update ".concat(args, " --env-vars-file=____envvars.yaml")], false);
41582
41585
  };
41583
41586
 
@@ -41586,10 +41589,13 @@ var createGoogleCloudRunDeployJobs = function (context) {
41586
41589
  };
41587
41590
 
41588
41591
  var getFullJobName = function (name) {
41589
- return context.environment.fullName.toLowerCase() + "-" + name;
41592
+ return context.environment.fullName.toLowerCase() + "-" + name.toLowerCase();
41590
41593
  };
41591
41594
 
41592
- var jobsWithNames = Object.entries((_a = deployConfig.jobs) !== null && _a !== void 0 ? _a : {}).map(function (_a) {
41595
+ var jobsWithNames = Object.entries((_a = deployConfig.jobs) !== null && _a !== void 0 ? _a : {}) // filter out disabled jobs
41596
+ .filter(function (entry) {
41597
+ return Boolean(entry[1]);
41598
+ }).map(function (_a) {
41593
41599
  var _b = __read(_a, 2),
41594
41600
  name = _b[0],
41595
41601
  job = _b[1];
@@ -41597,7 +41603,8 @@ var createGoogleCloudRunDeployJobs = function (context) {
41597
41603
  return [getFullJobName(name), job];
41598
41604
  });
41599
41605
 
41600
- var cloudRunDeployScripts = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(["echo \"$ENV_VARS\" > ____envvars.yaml", "cat ____envvars.yaml"], __read(jobsWithNames.map(function (_a) {
41606
+ var cloudRunDeployScripts = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(["echo \"$ENV_VARS\" > ____envvars.yaml"], __read(deployConfig.cloudSql ? (0, database_1.getDatabaseCreateScript)(context, deployConfig) // we create the db, so that we can also delete it afterwards
41607
+ : []), false), __read(jobsWithNames.map(function (_a) {
41601
41608
  var _b = __read(_a, 2),
41602
41609
  name = _b[0],
41603
41610
  job = _b[1];
@@ -41605,37 +41612,32 @@ var createGoogleCloudRunDeployJobs = function (context) {
41605
41612
  return getJobCreateScripts(name, job);
41606
41613
  }).flat()), false), __read(jobsWithNames.filter(function (_a) {
41607
41614
  var _b = __read(_a, 2),
41608
- name = _b[0],
41609
41615
  job = _b[1];
41610
41616
 
41611
41617
  return job.when === "preDeploy";
41612
41618
  }).map(function (_a) {
41613
- var _b = __read(_a, 2),
41614
- name = _b[0],
41615
- job = _b[1];
41619
+ var _b = __read(_a, 1),
41620
+ name = _b[0];
41616
41621
 
41617
41622
  return getJobRunScript(name);
41618
41623
  })), false), __read(deployConfig.service !== false ? [getServiceDeployScript(deployConfig.service)] : []), false), __read(jobsWithNames.filter(function (_a) {
41619
41624
  var _b = __read(_a, 2),
41620
- name = _b[0],
41621
41625
  job = _b[1];
41622
41626
 
41623
41627
  return job.when === "postDeploy";
41624
41628
  }).map(function (_a) {
41625
- var _b = __read(_a, 2),
41626
- name = _b[0],
41627
- job = _b[1];
41629
+ var _b = __read(_a, 1),
41630
+ name = _b[0];
41628
41631
 
41629
41632
  return getJobRunScript(name);
41630
41633
  })), false), ["docker image rm ".concat(gcloudImageName)], false);
41631
41634
 
41632
- var cloudRunStopScripts = __spreadArray(__spreadArray([], __read(deployConfig.service !== false ? ["gcloud run services delete ".concat(serviceName, " ").concat(commonArgs)] : []), false), __read(Object.entries((_b = deployConfig.jobs) !== null && _b !== void 0 ? _b : {}).map(function (_a) {
41633
- var _b = __read(_a, 2),
41634
- name = _b[0],
41635
- job = _b[1];
41635
+ var cloudRunStopScripts = __spreadArray(__spreadArray(__spreadArray([], __read(deployConfig.service !== false ? ["gcloud run services delete ".concat(serviceName, " ").concat(commonArgs)] : []), false), __read(jobsWithNames.map(function (_a) {
41636
+ var _b = __read(_a, 1),
41637
+ name = _b[0];
41636
41638
 
41637
- return "gcloud beta run jobs delete ".concat(getFullJobName(name), " ").concat(commonArgs);
41638
- })), false);
41639
+ return "gcloud beta run jobs delete ".concat(name, " ").concat(commonArgs);
41640
+ })), false), __read(deployConfig.cloudSql && deployConfig.cloudSql.deleteDatabaseOnStop ? (0, database_1.getDatabaseDeleteScript)(context, deployConfig) : []), false);
41639
41641
 
41640
41642
  var baseStopJob = (0, base_1.getBaseDeploymentStopJob)(context);
41641
41643
  return [(0, lodash_1.merge)({}, baseDeploymentJob, (0, docker_1.getDockerJobBaseProps)(context), {
@@ -41710,6 +41712,16 @@ var __read = this && this.__read || function (o, n) {
41710
41712
  return ar;
41711
41713
  };
41712
41714
 
41715
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
41716
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
41717
+ if (ar || !(i in from)) {
41718
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
41719
+ ar[i] = from[i];
41720
+ }
41721
+ }
41722
+ return to.concat(ar || Array.prototype.slice.call(from));
41723
+ };
41724
+
41713
41725
  exports.__esModule = true;
41714
41726
  exports.GCLOUD_RUN_DEPLOY_TYPE = exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = void 0;
41715
41727
 
@@ -41721,13 +41733,50 @@ var deployJob_1 = __nccwpck_require__(2256);
41721
41733
 
41722
41734
  exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = "GCLOUD_DEPLOY_credentialsKey";
41723
41735
  exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = "GCLOUD_RUN_canonicalHostSuffix";
41736
+
41737
+ var getCloudSqlVariables = function (_a) {
41738
+ var _b;
41739
+
41740
+ var deployConfigRaw = _a.deployConfigRaw,
41741
+ environmentSlug = _a.environmentSlug,
41742
+ env = _a.env,
41743
+ componentName = _a.componentName,
41744
+ fullConfig = _a.fullConfig;
41745
+
41746
+ if (deployConfigRaw && deployConfigRaw.cloudSql) {
41747
+ var DB_NAME = [(_b = deployConfigRaw.cloudSql.dbNamePrefix) !== null && _b !== void 0 ? _b : "".concat(fullConfig.customerName, "-").concat(fullConfig.appName), environmentSlug].filter(Boolean).join("-");
41748
+ var hostAndDb = "localhost/$DB_NAME?host=/cloudsql/$CLOUD_SQL_INSTANCE_CONNECTION_NAME";
41749
+ return {
41750
+ CLOUD_SQL_INSTANCE_CONNECTION_NAME: deployConfigRaw.cloudSql.instanceConnectionName,
41751
+ DB_NAME: DB_NAME,
41752
+ DB_USER: "postgres",
41753
+ DB_PASSWORD: "$" + (0, context_1.getSecretVarName)(env, componentName, "DB_PASSWORD"),
41754
+ DATABASE_URL: "postgresql://$DB_USER:$DB_PASSWORD@".concat(hostAndDb),
41755
+ DATABASE_URL_NO_PW: "postgresql://".concat(hostAndDb)
41756
+ };
41757
+ }
41758
+
41759
+ return {};
41760
+ };
41761
+
41724
41762
  exports.GCLOUD_RUN_DEPLOY_TYPE = {
41725
41763
  jobs: deployJob_1.createGoogleCloudRunDeployJobs,
41726
- defaults: function () {
41764
+ defaults: function (_a) {
41765
+ var deployConfigRaw = _a.deployConfigRaw,
41766
+ envType = _a.envType;
41767
+
41768
+ if (deployConfigRaw && deployConfigRaw.cloudSql) {
41769
+ return {
41770
+ cloudSql: {
41771
+ deleteDatabaseOnStop: envType === "review"
41772
+ }
41773
+ };
41774
+ }
41775
+
41727
41776
  return {};
41728
41777
  },
41729
- additionalSecretKeys: function () {
41730
- return [exports.GCLOUD_DEPLOY_CREDENTIALS_KEY];
41778
+ additionalSecretKeys: function (ctx) {
41779
+ return __spreadArray([exports.GCLOUD_DEPLOY_CREDENTIALS_KEY], __read(ctx.deployConfigRaw && ctx.deployConfigRaw.cloudSql ? ["DB_PASSWORD"] : []), false);
41731
41780
  },
41732
41781
  getAdditionalEnvVars: function (ctx) {
41733
41782
  var fullName = ctx.fullName,
@@ -41742,69 +41791,121 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
41742
41791
 
41743
41792
  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(name, ":run")];
41744
41793
  })) : {};
41745
- return __assign({
41794
+ return __assign(__assign({
41746
41795
  HOST_CANONICAL: HOST_CANONICAL
41747
- }, jobTriggers);
41796
+ }, getCloudSqlVariables(ctx)), jobTriggers);
41748
41797
  }
41749
41798
  };
41750
41799
 
41751
41800
  /***/ }),
41752
41801
 
41753
- /***/ 2607:
41754
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
41802
+ /***/ 1384:
41803
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
41755
41804
 
41756
41805
  "use strict";
41757
41806
 
41758
41807
 
41808
+ var __read = this && this.__read || function (o, n) {
41809
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
41810
+ if (!m) return o;
41811
+ var i = m.call(o),
41812
+ r,
41813
+ ar = [],
41814
+ e;
41815
+
41816
+ try {
41817
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
41818
+ } catch (error) {
41819
+ e = {
41820
+ error: error
41821
+ };
41822
+ } finally {
41823
+ try {
41824
+ if (r && !r.done && (m = i["return"])) m.call(i);
41825
+ } finally {
41826
+ if (e) throw e.error;
41827
+ }
41828
+ }
41829
+
41830
+ return ar;
41831
+ };
41832
+
41759
41833
  exports.__esModule = true;
41760
- exports.gcloudServiceAccountLoginCommands = void 0;
41834
+ exports.getDatabaseCreateScript = exports.getDatabaseDeleteScript = void 0;
41761
41835
 
41762
- var __1 = __nccwpck_require__(1344);
41836
+ var gitlab_1 = __nccwpck_require__(4997);
41763
41837
 
41764
- var context_1 = __nccwpck_require__(2041);
41838
+ var getDatabaseDeleteScript = function (context, deployConfig) {
41839
+ var _a;
41765
41840
 
41766
- var gcloudServiceAccountLoginCommands = function (context) {
41767
- return ["echo $".concat((0, context_1.getSecretVarNameForContext)(context, __1.GCLOUD_DEPLOY_CREDENTIALS_KEY), " > ./____keyfile.json\n "), "gcloud auth activate-service-account --key-file=\"./____keyfile.json\""];
41768
- };
41841
+ if (!deployConfig.cloudSql || !deployConfig.cloudSql.deleteDatabaseOnStop) {
41842
+ throw new Error("not possible");
41843
+ }
41769
41844
 
41770
- exports.gcloudServiceAccountLoginCommands = gcloudServiceAccountLoginCommands;
41845
+ var DB_NAME = ((_a = context.environment.envVars) !== null && _a !== void 0 ? _a : {}).DB_NAME;
41771
41846
 
41772
- /***/ }),
41847
+ if (!DB_NAME) {
41848
+ throw new Error("error: env vars did not specify DB_NAME");
41849
+ }
41773
41850
 
41774
- /***/ 3539:
41775
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
41851
+ var _b = __read(deployConfig.cloudSql.instanceConnectionName.split(":"), 3),
41852
+ projectId = _b[0],
41853
+ region = _b[1],
41854
+ instanceId = _b[2]; // unfortunatly the database cannot be deleted right after the service has stopped, as it might still have connections
41855
+ // we have to repeate this process
41776
41856
 
41777
- "use strict";
41778
41857
 
41858
+ return ["echo \"deleting database ".concat(DB_NAME, "...\""), "echo \"\uD83D\uDC46 this can take multiple attemps (3-5min), because google cloud run may still have a connection to the database after the cloud run service is shut down\"", (0, gitlab_1.repeatOnFailure)("gcloud sql databases delete ".concat(DB_NAME, " --instance=").concat(instanceId, " --project ").concat(projectId), {
41859
+ pauseInSeconds: 10
41860
+ })];
41861
+ };
41779
41862
 
41780
- exports.__esModule = true;
41781
- exports.getCloudSQLConfig = exports.hasCloudSQL = void 0;
41863
+ exports.getDatabaseDeleteScript = getDatabaseDeleteScript;
41782
41864
 
41783
- var types_1 = __nccwpck_require__(3109);
41865
+ var getDatabaseCreateScript = function (context, deployConfig) {
41866
+ var _a;
41784
41867
 
41785
- var hasCloudSQL = function (context) {
41786
- var _a, _b;
41868
+ if (!deployConfig.cloudSql) {
41869
+ throw new Error("not possible");
41870
+ }
41787
41871
 
41788
- if ((0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
41789
- return (_b = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.cloudsql) === null || _b === void 0 ? void 0 : _b.enabled;
41872
+ var DB_NAME = ((_a = context.environment.envVars) !== null && _a !== void 0 ? _a : {}).DB_NAME;
41873
+
41874
+ if (!DB_NAME) {
41875
+ throw new Error("error: env vars did not specify DB_NAME");
41790
41876
  }
41791
41877
 
41792
- return false;
41878
+ var _b = __read(deployConfig.cloudSql.instanceConnectionName.split(":"), 3),
41879
+ projectId = _b[0],
41880
+ region = _b[1],
41881
+ instanceId = _b[2]; // may fail if it already exists
41882
+
41883
+
41884
+ return (0, gitlab_1.allowFailureInScripts)(["echo \"ensuring Database...\"", "gcloud sql databases create ".concat(DB_NAME, " --instance=").concat(instanceId, " --project ").concat(projectId)]);
41793
41885
  };
41794
41886
 
41795
- exports.hasCloudSQL = hasCloudSQL;
41887
+ exports.getDatabaseCreateScript = getDatabaseCreateScript;
41796
41888
 
41797
- var getCloudSQLConfig = function (context) {
41798
- var _a;
41889
+ /***/ }),
41799
41890
 
41800
- if ((0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
41801
- return (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.cloudsql;
41802
- }
41891
+ /***/ 2607:
41892
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
41803
41893
 
41804
- throw new Error("cannot get cloud sql config");
41894
+ "use strict";
41895
+
41896
+
41897
+ exports.__esModule = true;
41898
+ exports.gcloudServiceAccountLoginCommands = void 0;
41899
+
41900
+ var __1 = __nccwpck_require__(1344);
41901
+
41902
+ var context_1 = __nccwpck_require__(2041);
41903
+
41904
+ var gcloudServiceAccountLoginCommands = function (context) {
41905
+ return ["echo $".concat((0, context_1.getSecretVarNameForContext)(context, __1.GCLOUD_DEPLOY_CREDENTIALS_KEY), " > ./____keyfile.json\n "), "gcloud auth activate-service-account --key-file=\"./____keyfile.json\""];
41805
41906
  };
41806
41907
 
41807
- exports.getCloudSQLConfig = getCloudSQLConfig;
41908
+ exports.gcloudServiceAccountLoginCommands = gcloudServiceAccountLoginCommands;
41808
41909
 
41809
41910
  /***/ }),
41810
41911
 
@@ -42011,7 +42112,7 @@ var kubernetes_1 = __nccwpck_require__(5682);
42011
42112
 
42012
42113
  __exportStar(__nccwpck_require__(1344), exports);
42013
42114
 
42014
- __exportStar(__nccwpck_require__(3539), exports);
42115
+ __exportStar(__nccwpck_require__(1925), exports);
42015
42116
 
42016
42117
  __exportStar(__nccwpck_require__(5682), exports);
42017
42118
 
@@ -42068,6 +42169,43 @@ exports.additionalKubernetesSecretKeys = additionalKubernetesSecretKeys;
42068
42169
 
42069
42170
  /***/ }),
42070
42171
 
42172
+ /***/ 1925:
42173
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
42174
+
42175
+ "use strict";
42176
+
42177
+
42178
+ exports.__esModule = true;
42179
+ exports.getKubernetesCloudSQLConfig = exports.hasKubernetesCloudSQL = void 0;
42180
+
42181
+ var types_1 = __nccwpck_require__(3109);
42182
+
42183
+ var hasKubernetesCloudSQL = function (context) {
42184
+ var _a, _b;
42185
+
42186
+ if ((0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
42187
+ return (_b = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.cloudsql) === null || _b === void 0 ? void 0 : _b.enabled;
42188
+ }
42189
+
42190
+ return false;
42191
+ };
42192
+
42193
+ exports.hasKubernetesCloudSQL = hasKubernetesCloudSQL;
42194
+
42195
+ var getKubernetesCloudSQLConfig = function (context) {
42196
+ var _a;
42197
+
42198
+ if ((0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
42199
+ return (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.cloudsql;
42200
+ }
42201
+
42202
+ throw new Error("cannot get cloud sql config");
42203
+ };
42204
+
42205
+ exports.getKubernetesCloudSQLConfig = getKubernetesCloudSQLConfig;
42206
+
42207
+ /***/ }),
42208
+
42071
42209
  /***/ 395:
42072
42210
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
42073
42211
 
@@ -42404,7 +42542,7 @@ var lodash_1 = __nccwpck_require__(3255);
42404
42542
 
42405
42543
  var utils_1 = __nccwpck_require__(7461);
42406
42544
 
42407
- var cloudSql_1 = __nccwpck_require__(3539);
42545
+ var cloudSql_1 = __nccwpck_require__(1925);
42408
42546
 
42409
42547
  var types_1 = __nccwpck_require__(3109);
42410
42548
 
@@ -42474,7 +42612,7 @@ var createKubeValues = function (context) {
42474
42612
  var defaultKubeValues = (0, lodash_1.merge)({
42475
42613
  env: env,
42476
42614
  application: createAppConfig(context, application)
42477
- }, (0, cloudSql_1.hasCloudSQL)(context) ? (0, cloudsql_1.createCloudsqlBaseConfig)(context) : {}, ((_b = (_a = deployConfig.values) === null || _a === void 0 ? void 0 : _a.mongodb) === null || _b === void 0 ? void 0 : _b.enabled) ? (0, mongodb_1.createMongodbBaseConfig)(context) : {});
42615
+ }, (0, cloudSql_1.hasKubernetesCloudSQL)(context) ? (0, cloudsql_1.createCloudsqlBaseConfig)(context) : {}, ((_b = (_a = deployConfig.values) === null || _a === void 0 ? void 0 : _a.mongodb) === null || _b === void 0 ? void 0 : _b.enabled) ? (0, mongodb_1.createMongodbBaseConfig)(context) : {});
42478
42616
  var kubeValues = (0, processSecretsAsFiles_1.processSecretsAsFiles)((0, utils_1.mergeWithMergingArrays)(defaultKubeValues, rest));
42479
42617
  return kubeValues;
42480
42618
  };
@@ -44264,7 +44402,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
44264
44402
  };
44265
44403
 
44266
44404
  exports.__esModule = true;
44267
- exports.sanitizeForBashVariable = exports.allowFailureInScripts = void 0;
44405
+ exports.repeatOnFailure = exports.sanitizeForBashVariable = exports.allowFailureInScripts = void 0;
44268
44406
 
44269
44407
  var allowFailureInScripts = function (script) {
44270
44408
  return __spreadArray(__spreadArray(["set +e"], __read(script), false), ["set -e" // reenable
@@ -44279,6 +44417,12 @@ var sanitizeForBashVariable = function (name) {
44279
44417
 
44280
44418
  exports.sanitizeForBashVariable = sanitizeForBashVariable;
44281
44419
 
44420
+ var repeatOnFailure = function (command, options) {
44421
+ return "\n until ".concat(command, " &> /dev/null\n do\n echo \"Trying again.\"\n sleep ").concat(options.pauseInSeconds, "\n done\n ");
44422
+ };
44423
+
44424
+ exports.repeatOnFailure = repeatOnFailure;
44425
+
44282
44426
  /***/ }),
44283
44427
 
44284
44428
  /***/ 7461: