@catladder/cli 0.0.0-pipeline-variables-e3e4f641 → 0.0.0-pipeline-variables-4db9a8bc

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.
@@ -39522,7 +39522,7 @@ var createAppBuildJob = function (context, _a) {
39522
39522
  cache: [],
39523
39523
  variables: __assign(__assign(__assign(__assign({}, variables !== null && variables !== void 0 ? variables : {}), context.environment.envVars), context.environment.jobOnlyVars.build.envVars), (_b = context.componentConfig.build.extraVars) !== null && _b !== void 0 ? _b : {}),
39524
39524
  runnerVariables: __assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), runnerVariables !== null && runnerVariables !== void 0 ? runnerVariables : {}), (_c = context.componentConfig.build.runnerVariables) !== null && _c !== void 0 ? _c : {}),
39525
- script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(["env"], __read(context.componentConfig.dotEnv === true // don't build when set to `local`
39525
+ script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(context.componentConfig.dotEnv === true // don't build when set to `local`
39526
39526
  ? (0, writeDotEnv_1.writeDotEnv)(context) : []), false), __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.componentConfig.dir)], false), __read((_d = (0, utils_1.ensureArray)(script)) !== null && _d !== void 0 ? _d : []), false),
39527
39527
  artifacts: {
39528
39528
  paths: [(0, path_1.join)(context.componentConfig.dir, "__build_info.json")],
@@ -40111,7 +40111,7 @@ var createDockerBuildJobBase = function (context, _a) {
40111
40111
  envMode: "jobPerEnv",
40112
40112
  stage: "build"
40113
40113
  }, (0, exports.getDockerJobBaseProps)(context)), {
40114
- script: __spreadArray(["env"], __read(script || []), false)
40114
+ script: script || []
40115
40115
  }), {
40116
40116
  variables: (0, exports.getDockerBuildVariables)(context),
40117
40117
  runnerVariables: __assign(__assign({}, DOCKER_BUILD_RUNNER_REQUESTS), getDockerBuildRunnerVariables())
@@ -41217,7 +41217,7 @@ exports.readConfigSync = readConfigSync;
41217
41217
 
41218
41218
  exports.__esModule = true;
41219
41219
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
41220
- exports.PIPELINE_IMAGE_TAG = "pipeline-variables-e3e4f641" || 0;
41220
+ exports.PIPELINE_IMAGE_TAG = "pipeline-variables-4db9a8bc" || 0;
41221
41221
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
41222
41222
 
41223
41223
  /***/ }),
@@ -42557,7 +42557,7 @@ var createDeployJob = function (context, jobDefinition) {
42557
42557
  var whenDeploy = whenDeployDefined ? whenDeployDefined : whenDeployDefault;
42558
42558
  return {
42559
42559
  name: exports.DEPLOY_JOB_NAME,
42560
- script: __spreadArray(["env"], __read(jobDefinition.script), false),
42560
+ script: jobDefinition.script,
42561
42561
  image: jobDefinition.image,
42562
42562
  cache: jobDefinition.cache,
42563
42563
  artifacts: jobDefinition.artifacts,
@@ -43074,6 +43074,7 @@ var jobName_1 = __nccwpck_require__(7311);
43074
43074
  var common_1 = __nccwpck_require__(5655);
43075
43075
  var getLabels_1 = __nccwpck_require__(486);
43076
43076
  var volumes_1 = __nccwpck_require__(8662);
43077
+ var constants_1 = __nccwpck_require__(9948);
43077
43078
  var getJobRunScriptForJob = function (context, jobName, wait) {
43078
43079
  var commonArgs = (0, common_1.getCommonCloudRunArgs)(context);
43079
43080
  var commonArgsString = (0, createArgsString_1.createArgsString)(commonArgs);
@@ -43143,7 +43144,7 @@ var getJobCreateScriptsForJob = function (context, jobName, job) {
43143
43144
  memory: job.memory || "512Mi",
43144
43145
  "task-timeout": job.timeout || "10m",
43145
43146
  parallelism: job.parallelism || 1,
43146
- "env-vars-file": "____envvars.yaml",
43147
+ "env-vars-file": constants_1.ENV_VARS_FILENAME,
43147
43148
  "max-retries": 0
43148
43149
  }));
43149
43150
  var requiresBeta = (job === null || job === void 0 ? void 0 : job.volumes) && Object.keys(job === null || job === void 0 ? void 0 : job.volumes).length > 0;
@@ -43263,6 +43264,7 @@ var getLabels_1 = __nccwpck_require__(486);
43263
43264
  var createArgsString_1 = __nccwpck_require__(8686);
43264
43265
  var getServiceName_1 = __nccwpck_require__(9391);
43265
43266
  var common_1 = __nccwpck_require__(5655);
43267
+ var constants_1 = __nccwpck_require__(9948);
43266
43268
  var volumes_1 = __nccwpck_require__(8662);
43267
43269
  var getServiceDeployScript = function (context, service, nameSuffix) {
43268
43270
  var _a, _b, _c, _d, _e;
@@ -43279,7 +43281,7 @@ var getServiceDeployScript = function (context, service, nameSuffix) {
43279
43281
  labels: (0, common_1.makeLabelString)(__assign(__assign({}, (0, getLabels_1.getLabels)(context)), {
43280
43282
  "cloud-run-service-name": fullServiceName
43281
43283
  })),
43282
- "env-vars-file": "____envvars.yaml",
43284
+ "env-vars-file": constants_1.ENV_VARS_FILENAME,
43283
43285
  "min-instances": (_b = customConfig === null || customConfig === void 0 ? void 0 : customConfig.minInstances) !== null && _b !== void 0 ? _b : 0,
43284
43286
  "max-instances": (_c = customConfig === null || customConfig === void 0 ? void 0 : customConfig.maxInstances) !== null && _c !== void 0 ? _c : 100,
43285
43287
  "cpu-throttling": (customConfig === null || customConfig === void 0 ? void 0 : customConfig.noCpuThrottling) !== true,
@@ -43403,6 +43405,18 @@ exports.getCommonDeployArgs = getCommonDeployArgs;
43403
43405
 
43404
43406
  /***/ }),
43405
43407
 
43408
+ /***/ 9948:
43409
+ /***/ ((__unused_webpack_module, exports) => {
43410
+
43411
+ "use strict";
43412
+
43413
+
43414
+ exports.__esModule = true;
43415
+ exports.ENV_VARS_FILENAME = void 0;
43416
+ exports.ENV_VARS_FILENAME = "____envvars.yaml";
43417
+
43418
+ /***/ }),
43419
+
43406
43420
  /***/ 1944:
43407
43421
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
43408
43422
 
@@ -43442,6 +43456,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
43442
43456
  };
43443
43457
  exports.__esModule = true;
43444
43458
  exports.getCloudRunDeployScripts = void 0;
43459
+ var lodash_1 = __nccwpck_require__(3255);
43445
43460
  var gitlab_1 = __nccwpck_require__(4997);
43446
43461
  var sbom_1 = __nccwpck_require__(5928);
43447
43462
  var cleanup_1 = __nccwpck_require__(964);
@@ -43450,10 +43465,13 @@ var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(2607);
43450
43465
  var cloudRunJobs_1 = __nccwpck_require__(6321);
43451
43466
  var cloudRunServices_1 = __nccwpck_require__(7210);
43452
43467
  var common_1 = __nccwpck_require__(5655);
43468
+ var __1 = __nccwpck_require__(1344);
43469
+ var constants_1 = __nccwpck_require__(9948);
43453
43470
  function getCloudRunDeployScripts(context) {
43454
43471
  var _a;
43455
43472
  var deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
43456
- return __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gitlab_1.collapseableSection)("prepare", "Prepare...")(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read((0, common_1.setGoogleProjectNumberScript)(deployConfig)), false))), false), __read((0, gitlab_1.collapseableSection)("deploy", "Deploy to cloud run")(__spreadArray(__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
43473
+ var allEnvVars = (0, lodash_1.omit)(context.environment.envVars, __1.GCLOUD_DEPLOY_CREDENTIALS_KEY);
43474
+ return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gitlab_1.collapseableSection)("prepare", "Prepare...")(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read((0, common_1.setGoogleProjectNumberScript)(deployConfig)), false))), false), __read((0, gitlab_1.collapseableSection)("writeenvvars", "Write env vars to file")(writeEnvVarsIntoJSONFileScript(allEnvVars, constants_1.ENV_VARS_FILENAME))), false), __read((0, gitlab_1.collapseableSection)("deploy", "Deploy to cloud run")(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(deployConfig.cloudSql ? (0, database_1.getDatabaseCreateScript)(context, deployConfig) // we create the db, so that we can also delete it afterwards
43457
43475
  : []), false), __read((0, cloudRunJobs_1.getCreateScheduleScripts)(context)), false), __read((0, cloudRunJobs_1.getJobCreateScripts)(context)), false), __read((0, cloudRunJobs_1.getJobRunScripts)(context, "preDeploy")), false), __read(deployConfig.service !== false ? [(0, cloudRunServices_1.getServiceDeployScript)(context, deployConfig.service)] : []), false), __read(Object.entries((_a = deployConfig.additionalServices) !== null && _a !== void 0 ? _a : {}).map(function (_a) {
43458
43476
  var _b = __read(_a, 2),
43459
43477
  name = _b[0],
@@ -43463,6 +43481,19 @@ function getCloudRunDeployScripts(context) {
43463
43481
  )), false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false);
43464
43482
  }
43465
43483
  exports.getCloudRunDeployScripts = getCloudRunDeployScripts;
43484
+ var writeEnvVarsIntoJSONFileScript = function (vars, filename) {
43485
+ return __spreadArray([
43486
+ // create empty file
43487
+ "echo '' > ".concat(filename)], __read(Object.entries(vars).map(function (_a) {
43488
+ var _b = __read(_a, 2),
43489
+ key = _b[0],
43490
+ value = _b[1];
43491
+ return "echo \"".concat(key, ": '").concat(value.toString().replaceAll(
43492
+ // replace single line break with two line breaks
43493
+ // this is because how yaml interprets single line breaks
43494
+ /\n/g, "\\n\\n"), "'\" >> ").concat(filename);
43495
+ })), false);
43496
+ };
43466
43497
 
43467
43498
  /***/ }),
43468
43499
 
@@ -43533,13 +43564,11 @@ exports.getCloudRunStopScripts = getCloudRunStopScripts;
43533
43564
 
43534
43565
  exports.__esModule = true;
43535
43566
  exports.createGoogleCloudRunDeployJobs = void 0;
43536
- var lodash_1 = __nccwpck_require__(3255);
43537
- var docker_1 = __nccwpck_require__(3219);
43538
43567
  var runner_1 = __nccwpck_require__(5071);
43539
43568
  var gitlab_1 = __nccwpck_require__(4997);
43540
43569
  var base_1 = __nccwpck_require__(2866);
43541
43570
  var types_1 = __nccwpck_require__(3109);
43542
- var variables_1 = __nccwpck_require__(408);
43571
+ var constants_1 = __nccwpck_require__(9948);
43543
43572
  var getCloudRunDeployScripts_1 = __nccwpck_require__(1944);
43544
43573
  var getCloudRunStopScripts_1 = __nccwpck_require__(910);
43545
43574
  var createGoogleCloudRunDeployJobs = function (context) {
@@ -43554,14 +43583,18 @@ var createGoogleCloudRunDeployJobs = function (context) {
43554
43583
  var deployScripts = (0, getCloudRunDeployScripts_1.getCloudRunDeployScripts)(context);
43555
43584
  var stopScripts = (0, getCloudRunStopScripts_1.getCloudRunStopScripts)(context);
43556
43585
  return (0, base_1.createDeployementJobs)(context, {
43557
- deploy: (0, lodash_1.merge)((0, docker_1.getDockerJobBaseProps)(context), {
43586
+ deploy: {
43587
+ variables: {
43588
+ CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
43589
+ },
43558
43590
  artifacts: {
43559
- paths: ["____envvars.yaml"]
43591
+ paths: [constants_1.ENV_VARS_FILENAME // debug
43592
+ ]
43560
43593
  },
43561
- variables: (0, variables_1.getDeployJobVariables)(context),
43594
+
43562
43595
  image: (0, runner_1.getRunnerImage)("gcloud"),
43563
43596
  script: deployScripts
43564
- }),
43597
+ },
43565
43598
  stop: {
43566
43599
  image: (0, runner_1.getRunnerImage)("gcloud"),
43567
43600
  variables: {
@@ -43575,33 +43608,6 @@ exports.createGoogleCloudRunDeployJobs = createGoogleCloudRunDeployJobs;
43575
43608
 
43576
43609
  /***/ }),
43577
43610
 
43578
- /***/ 408:
43579
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
43580
-
43581
- "use strict";
43582
-
43583
-
43584
- exports.__esModule = true;
43585
- exports.getDeployJobVariables = void 0;
43586
- var js_yaml_1 = __nccwpck_require__(3618);
43587
- var lodash_1 = __nccwpck_require__(3255);
43588
- var __1 = __nccwpck_require__(5355);
43589
- function getDeployJobVariables(context) {
43590
- var allEnvVars = (0, lodash_1.omit)(context.environment.envVars, __1.GCLOUD_DEPLOY_CREDENTIALS_KEY);
43591
- return {
43592
- CLOUDSDK_CORE_DISABLE_PROMPTS: "1",
43593
- ENV_VARS: (0, js_yaml_1.dump)(allEnvVars, {
43594
- lineWidth: -1,
43595
- quotingType: "'",
43596
- forceQuotes: true,
43597
- noRefs: true
43598
- })
43599
- };
43600
- }
43601
- exports.getDeployJobVariables = getDeployJobVariables;
43602
-
43603
- /***/ }),
43604
-
43605
43611
  /***/ 8662:
43606
43612
  /***/ (function(__unused_webpack_module, exports) {
43607
43613
 
@@ -46314,9 +46320,7 @@ var makeGitlabJob = function (componentName, env, _a, allJobs) {
46314
46320
  }
46315
46321
  var modified = addGitlabEnvironment(context, environment, __assign(__assign({}, job), {
46316
46322
  variables: __assign(__assign({}, legacyRunnerVariables), runnerVariables),
46317
- script: __spreadArray(__spreadArray([], __read(varsInjectScripts), false), __read(((_b = script === null || script === void 0 ? void 0 : script.filter(utils_1.notNil)) !== null && _b !== void 0 ? _b : []).flatMap(function (s) {
46318
- return ["echo \"".concat(s, "\""), s];
46319
- })), false),
46323
+ script: __spreadArray(__spreadArray([], __read(varsInjectScripts), false), __read((_b = script === null || script === void 0 ? void 0 : script.filter(utils_1.notNil)) !== null && _b !== void 0 ? _b : []), false),
46320
46324
  tags: jobTags,
46321
46325
  stage: stage,
46322
46326
  // sort in a predictable manner for snapshot tests
@@ -46342,7 +46346,7 @@ allJobs) {
46342
46346
  restEnvironment = __rest(environment, ["on_stop"]);
46343
46347
  // those can be dynamic, so we therefore have to do this: https://docs.gitlab.com/ee/ci/environments/#set-a-dynamic-environment-url
46344
46348
  var dotEnvFile = "gitlab_environment.env";
46345
- var scriptToAdd = ["- echo \"".concat(exports.GITLAB_ENVIRONMENT_URL_VARIABLE, "=").concat(url, "\" >> ").concat(dotEnvFile)];
46349
+ var scriptToAdd = ["echo \"".concat(exports.GITLAB_ENVIRONMENT_URL_VARIABLE, "=").concat(url, "\" >> ").concat(dotEnvFile)];
46346
46350
  // this is NOT a bashVariable since it NEEDS to be used as a string in gitlab
46347
46351
  var gitlabEnvironmentName = envType === "review" ? "".concat(env, "/$CI_COMMIT_REF_NAME/").concat(componentName) // FIXME: should be replaced with mr name as well
46348
46352
  : "".concat(env, "/").concat(componentName);
@@ -354454,7 +354454,7 @@ var createAppBuildJob = function (context, _a) {
354454
354454
  cache: [],
354455
354455
  variables: __assign(__assign(__assign(__assign({}, variables !== null && variables !== void 0 ? variables : {}), context.environment.envVars), context.environment.jobOnlyVars.build.envVars), (_b = context.componentConfig.build.extraVars) !== null && _b !== void 0 ? _b : {}),
354456
354456
  runnerVariables: __assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), runnerVariables !== null && runnerVariables !== void 0 ? runnerVariables : {}), (_c = context.componentConfig.build.runnerVariables) !== null && _c !== void 0 ? _c : {}),
354457
- script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(["env"], __read(context.componentConfig.dotEnv === true // don't build when set to `local`
354457
+ script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(context.componentConfig.dotEnv === true // don't build when set to `local`
354458
354458
  ? (0, writeDotEnv_1.writeDotEnv)(context) : []), false), __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.componentConfig.dir)], false), __read((_d = (0, utils_1.ensureArray)(script)) !== null && _d !== void 0 ? _d : []), false),
354459
354459
  artifacts: {
354460
354460
  paths: [(0, path_1.join)(context.componentConfig.dir, "__build_info.json")],
@@ -355043,7 +355043,7 @@ var createDockerBuildJobBase = function (context, _a) {
355043
355043
  envMode: "jobPerEnv",
355044
355044
  stage: "build"
355045
355045
  }, (0, exports.getDockerJobBaseProps)(context)), {
355046
- script: __spreadArray(["env"], __read(script || []), false)
355046
+ script: script || []
355047
355047
  }), {
355048
355048
  variables: (0, exports.getDockerBuildVariables)(context),
355049
355049
  runnerVariables: __assign(__assign({}, DOCKER_BUILD_RUNNER_REQUESTS), getDockerBuildRunnerVariables())
@@ -356149,7 +356149,7 @@ exports.readConfigSync = readConfigSync;
356149
356149
 
356150
356150
  exports.__esModule = true;
356151
356151
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
356152
- exports.PIPELINE_IMAGE_TAG = "pipeline-variables-e3e4f641" || 0;
356152
+ exports.PIPELINE_IMAGE_TAG = "pipeline-variables-4db9a8bc" || 0;
356153
356153
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
356154
356154
 
356155
356155
  /***/ }),
@@ -357489,7 +357489,7 @@ var createDeployJob = function (context, jobDefinition) {
357489
357489
  var whenDeploy = whenDeployDefined ? whenDeployDefined : whenDeployDefault;
357490
357490
  return {
357491
357491
  name: exports.DEPLOY_JOB_NAME,
357492
- script: __spreadArray(["env"], __read(jobDefinition.script), false),
357492
+ script: jobDefinition.script,
357493
357493
  image: jobDefinition.image,
357494
357494
  cache: jobDefinition.cache,
357495
357495
  artifacts: jobDefinition.artifacts,
@@ -358006,6 +358006,7 @@ var jobName_1 = __nccwpck_require__(77311);
358006
358006
  var common_1 = __nccwpck_require__(75655);
358007
358007
  var getLabels_1 = __nccwpck_require__(30486);
358008
358008
  var volumes_1 = __nccwpck_require__(84497);
358009
+ var constants_1 = __nccwpck_require__(79948);
358009
358010
  var getJobRunScriptForJob = function (context, jobName, wait) {
358010
358011
  var commonArgs = (0, common_1.getCommonCloudRunArgs)(context);
358011
358012
  var commonArgsString = (0, createArgsString_1.createArgsString)(commonArgs);
@@ -358075,7 +358076,7 @@ var getJobCreateScriptsForJob = function (context, jobName, job) {
358075
358076
  memory: job.memory || "512Mi",
358076
358077
  "task-timeout": job.timeout || "10m",
358077
358078
  parallelism: job.parallelism || 1,
358078
- "env-vars-file": "____envvars.yaml",
358079
+ "env-vars-file": constants_1.ENV_VARS_FILENAME,
358079
358080
  "max-retries": 0
358080
358081
  }));
358081
358082
  var requiresBeta = (job === null || job === void 0 ? void 0 : job.volumes) && Object.keys(job === null || job === void 0 ? void 0 : job.volumes).length > 0;
@@ -358195,6 +358196,7 @@ var getLabels_1 = __nccwpck_require__(30486);
358195
358196
  var createArgsString_1 = __nccwpck_require__(8686);
358196
358197
  var getServiceName_1 = __nccwpck_require__(89391);
358197
358198
  var common_1 = __nccwpck_require__(75655);
358199
+ var constants_1 = __nccwpck_require__(79948);
358198
358200
  var volumes_1 = __nccwpck_require__(84497);
358199
358201
  var getServiceDeployScript = function (context, service, nameSuffix) {
358200
358202
  var _a, _b, _c, _d, _e;
@@ -358211,7 +358213,7 @@ var getServiceDeployScript = function (context, service, nameSuffix) {
358211
358213
  labels: (0, common_1.makeLabelString)(__assign(__assign({}, (0, getLabels_1.getLabels)(context)), {
358212
358214
  "cloud-run-service-name": fullServiceName
358213
358215
  })),
358214
- "env-vars-file": "____envvars.yaml",
358216
+ "env-vars-file": constants_1.ENV_VARS_FILENAME,
358215
358217
  "min-instances": (_b = customConfig === null || customConfig === void 0 ? void 0 : customConfig.minInstances) !== null && _b !== void 0 ? _b : 0,
358216
358218
  "max-instances": (_c = customConfig === null || customConfig === void 0 ? void 0 : customConfig.maxInstances) !== null && _c !== void 0 ? _c : 100,
358217
358219
  "cpu-throttling": (customConfig === null || customConfig === void 0 ? void 0 : customConfig.noCpuThrottling) !== true,
@@ -358335,6 +358337,18 @@ exports.getCommonDeployArgs = getCommonDeployArgs;
358335
358337
 
358336
358338
  /***/ }),
358337
358339
 
358340
+ /***/ 79948:
358341
+ /***/ ((__unused_webpack_module, exports) => {
358342
+
358343
+ "use strict";
358344
+
358345
+
358346
+ exports.__esModule = true;
358347
+ exports.ENV_VARS_FILENAME = void 0;
358348
+ exports.ENV_VARS_FILENAME = "____envvars.yaml";
358349
+
358350
+ /***/ }),
358351
+
358338
358352
  /***/ 21944:
358339
358353
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
358340
358354
 
@@ -358374,6 +358388,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
358374
358388
  };
358375
358389
  exports.__esModule = true;
358376
358390
  exports.getCloudRunDeployScripts = void 0;
358391
+ var lodash_1 = __nccwpck_require__(23255);
358377
358392
  var gitlab_1 = __nccwpck_require__(84997);
358378
358393
  var sbom_1 = __nccwpck_require__(65928);
358379
358394
  var cleanup_1 = __nccwpck_require__(10964);
@@ -358382,10 +358397,13 @@ var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(22607);
358382
358397
  var cloudRunJobs_1 = __nccwpck_require__(66321);
358383
358398
  var cloudRunServices_1 = __nccwpck_require__(77210);
358384
358399
  var common_1 = __nccwpck_require__(75655);
358400
+ var __1 = __nccwpck_require__(81344);
358401
+ var constants_1 = __nccwpck_require__(79948);
358385
358402
  function getCloudRunDeployScripts(context) {
358386
358403
  var _a;
358387
358404
  var deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
358388
- return __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gitlab_1.collapseableSection)("prepare", "Prepare...")(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read((0, common_1.setGoogleProjectNumberScript)(deployConfig)), false))), false), __read((0, gitlab_1.collapseableSection)("deploy", "Deploy to cloud run")(__spreadArray(__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
358405
+ var allEnvVars = (0, lodash_1.omit)(context.environment.envVars, __1.GCLOUD_DEPLOY_CREDENTIALS_KEY);
358406
+ return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gitlab_1.collapseableSection)("prepare", "Prepare...")(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read((0, common_1.setGoogleProjectNumberScript)(deployConfig)), false))), false), __read((0, gitlab_1.collapseableSection)("writeenvvars", "Write env vars to file")(writeEnvVarsIntoJSONFileScript(allEnvVars, constants_1.ENV_VARS_FILENAME))), false), __read((0, gitlab_1.collapseableSection)("deploy", "Deploy to cloud run")(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(deployConfig.cloudSql ? (0, database_1.getDatabaseCreateScript)(context, deployConfig) // we create the db, so that we can also delete it afterwards
358389
358407
  : []), false), __read((0, cloudRunJobs_1.getCreateScheduleScripts)(context)), false), __read((0, cloudRunJobs_1.getJobCreateScripts)(context)), false), __read((0, cloudRunJobs_1.getJobRunScripts)(context, "preDeploy")), false), __read(deployConfig.service !== false ? [(0, cloudRunServices_1.getServiceDeployScript)(context, deployConfig.service)] : []), false), __read(Object.entries((_a = deployConfig.additionalServices) !== null && _a !== void 0 ? _a : {}).map(function (_a) {
358390
358408
  var _b = __read(_a, 2),
358391
358409
  name = _b[0],
@@ -358395,6 +358413,19 @@ function getCloudRunDeployScripts(context) {
358395
358413
  )), false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false);
358396
358414
  }
358397
358415
  exports.getCloudRunDeployScripts = getCloudRunDeployScripts;
358416
+ var writeEnvVarsIntoJSONFileScript = function (vars, filename) {
358417
+ return __spreadArray([
358418
+ // create empty file
358419
+ "echo '' > ".concat(filename)], __read(Object.entries(vars).map(function (_a) {
358420
+ var _b = __read(_a, 2),
358421
+ key = _b[0],
358422
+ value = _b[1];
358423
+ return "echo \"".concat(key, ": '").concat(value.toString().replaceAll(
358424
+ // replace single line break with two line breaks
358425
+ // this is because how yaml interprets single line breaks
358426
+ /\n/g, "\\n\\n"), "'\" >> ").concat(filename);
358427
+ })), false);
358428
+ };
358398
358429
 
358399
358430
  /***/ }),
358400
358431
 
@@ -358465,13 +358496,11 @@ exports.getCloudRunStopScripts = getCloudRunStopScripts;
358465
358496
 
358466
358497
  exports.__esModule = true;
358467
358498
  exports.createGoogleCloudRunDeployJobs = void 0;
358468
- var lodash_1 = __nccwpck_require__(23255);
358469
- var docker_1 = __nccwpck_require__(33219);
358470
358499
  var runner_1 = __nccwpck_require__(55071);
358471
358500
  var gitlab_1 = __nccwpck_require__(84997);
358472
358501
  var base_1 = __nccwpck_require__(82866);
358473
358502
  var types_1 = __nccwpck_require__(63109);
358474
- var variables_1 = __nccwpck_require__(20408);
358503
+ var constants_1 = __nccwpck_require__(79948);
358475
358504
  var getCloudRunDeployScripts_1 = __nccwpck_require__(21944);
358476
358505
  var getCloudRunStopScripts_1 = __nccwpck_require__(40910);
358477
358506
  var createGoogleCloudRunDeployJobs = function (context) {
@@ -358486,14 +358515,18 @@ var createGoogleCloudRunDeployJobs = function (context) {
358486
358515
  var deployScripts = (0, getCloudRunDeployScripts_1.getCloudRunDeployScripts)(context);
358487
358516
  var stopScripts = (0, getCloudRunStopScripts_1.getCloudRunStopScripts)(context);
358488
358517
  return (0, base_1.createDeployementJobs)(context, {
358489
- deploy: (0, lodash_1.merge)((0, docker_1.getDockerJobBaseProps)(context), {
358518
+ deploy: {
358519
+ variables: {
358520
+ CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
358521
+ },
358490
358522
  artifacts: {
358491
- paths: ["____envvars.yaml"]
358523
+ paths: [constants_1.ENV_VARS_FILENAME // debug
358524
+ ]
358492
358525
  },
358493
- variables: (0, variables_1.getDeployJobVariables)(context),
358526
+
358494
358527
  image: (0, runner_1.getRunnerImage)("gcloud"),
358495
358528
  script: deployScripts
358496
- }),
358529
+ },
358497
358530
  stop: {
358498
358531
  image: (0, runner_1.getRunnerImage)("gcloud"),
358499
358532
  variables: {
@@ -358507,33 +358540,6 @@ exports.createGoogleCloudRunDeployJobs = createGoogleCloudRunDeployJobs;
358507
358540
 
358508
358541
  /***/ }),
358509
358542
 
358510
- /***/ 20408:
358511
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
358512
-
358513
- "use strict";
358514
-
358515
-
358516
- exports.__esModule = true;
358517
- exports.getDeployJobVariables = void 0;
358518
- var js_yaml_1 = __nccwpck_require__(3618);
358519
- var lodash_1 = __nccwpck_require__(23255);
358520
- var __1 = __nccwpck_require__(25355);
358521
- function getDeployJobVariables(context) {
358522
- var allEnvVars = (0, lodash_1.omit)(context.environment.envVars, __1.GCLOUD_DEPLOY_CREDENTIALS_KEY);
358523
- return {
358524
- CLOUDSDK_CORE_DISABLE_PROMPTS: "1",
358525
- ENV_VARS: (0, js_yaml_1.dump)(allEnvVars, {
358526
- lineWidth: -1,
358527
- quotingType: "'",
358528
- forceQuotes: true,
358529
- noRefs: true
358530
- })
358531
- };
358532
- }
358533
- exports.getDeployJobVariables = getDeployJobVariables;
358534
-
358535
- /***/ }),
358536
-
358537
358543
  /***/ 84497:
358538
358544
  /***/ (function(__unused_webpack_module, exports) {
358539
358545
 
@@ -361246,9 +361252,7 @@ var makeGitlabJob = function (componentName, env, _a, allJobs) {
361246
361252
  }
361247
361253
  var modified = addGitlabEnvironment(context, environment, __assign(__assign({}, job), {
361248
361254
  variables: __assign(__assign({}, legacyRunnerVariables), runnerVariables),
361249
- script: __spreadArray(__spreadArray([], __read(varsInjectScripts), false), __read(((_b = script === null || script === void 0 ? void 0 : script.filter(utils_1.notNil)) !== null && _b !== void 0 ? _b : []).flatMap(function (s) {
361250
- return ["echo \"".concat(s, "\""), s];
361251
- })), false),
361255
+ script: __spreadArray(__spreadArray([], __read(varsInjectScripts), false), __read((_b = script === null || script === void 0 ? void 0 : script.filter(utils_1.notNil)) !== null && _b !== void 0 ? _b : []), false),
361252
361256
  tags: jobTags,
361253
361257
  stage: stage,
361254
361258
  // sort in a predictable manner for snapshot tests
@@ -361274,7 +361278,7 @@ allJobs) {
361274
361278
  restEnvironment = __rest(environment, ["on_stop"]);
361275
361279
  // those can be dynamic, so we therefore have to do this: https://docs.gitlab.com/ee/ci/environments/#set-a-dynamic-environment-url
361276
361280
  var dotEnvFile = "gitlab_environment.env";
361277
- var scriptToAdd = ["- echo \"".concat(exports.GITLAB_ENVIRONMENT_URL_VARIABLE, "=").concat(url, "\" >> ").concat(dotEnvFile)];
361281
+ var scriptToAdd = ["echo \"".concat(exports.GITLAB_ENVIRONMENT_URL_VARIABLE, "=").concat(url, "\" >> ").concat(dotEnvFile)];
361278
361282
  // this is NOT a bashVariable since it NEEDS to be used as a string in gitlab
361279
361283
  var gitlabEnvironmentName = envType === "review" ? "".concat(env, "/$CI_COMMIT_REF_NAME/").concat(componentName) // FIXME: should be replaced with mr name as well
361280
361284
  : "".concat(env, "/").concat(componentName);
package/package.json CHANGED
@@ -52,7 +52,7 @@
52
52
  }
53
53
  ],
54
54
  "license": "MIT",
55
- "version": "0.0.0-pipeline-variables-e3e4f641",
55
+ "version": "0.0.0-pipeline-variables-4db9a8bc",
56
56
  "scripts": {
57
57
  "lint": "eslint \"src/**/*.ts\"",
58
58
  "lint:fix": "eslint \"src/**/*.ts\" --fix",
@@ -74,7 +74,7 @@
74
74
  "ts-node": "^10.9.1"
75
75
  },
76
76
  "devDependencies": {
77
- "@catladder/pipeline": "0.0.0-pipeline-variables-e3e4f641",
77
+ "@catladder/pipeline": "0.0.0-pipeline-variables-4db9a8bc",
78
78
  "@gitbeaker/rest": "^39.28.0",
79
79
  "@kubernetes/client-node": "^0.16.2",
80
80
  "@tsconfig/node14": "^1.0.1",