@catladder/cli 0.0.0-refactor-gitlab-jobs-9e285eaf → 0.0.0-refactor-gitlab-jobs-c23038ea

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.
@@ -39053,18 +39053,22 @@ var requiresDockerBuild = function (context) {
39053
39053
  return false;
39054
39054
  };
39055
39055
  exports.requiresDockerBuild = requiresDockerBuild;
39056
+ var getDockerBaseVariables = function () {
39057
+ return {
39058
+ DOCKER_HOST: "tcp://0.0.0.0:2375",
39059
+ DOCKER_TLS_CERTDIR: "",
39060
+ DOCKER_DRIVER: "overlay2",
39061
+ DOCKER_BUILDKIT: "1"
39062
+ };
39063
+ };
39056
39064
  var getDockerBuildVariables = function (context) {
39057
39065
  var _a, _b, _c, _d;
39058
- return __assign(__assign(__assign({}, DOCKER_RUNNER_BUILD_VARIABLES), {
39059
- DOCKER_BUILDKIT: "1",
39066
+ return __assign(__assign(__assign(__assign({}, DOCKER_RUNNER_BUILD_VARIABLES), {
39060
39067
  DOCKERFILE_ADDITIONS: (_b = (_a = context.componentConfig.build.docker) === null || _a === void 0 ? void 0 : _a.additionsBegin) === null || _b === void 0 ? void 0 : _b.join("\n"),
39061
39068
  DOCKERFILE_ADDITIONS_END: (_d = (_c = context.componentConfig.build.docker) === null || _c === void 0 ? void 0 : _c.additionsEnd) === null || _d === void 0 ? void 0 : _d.join("\n"),
39062
39069
  APP_DIR: context.componentConfig.dir,
39063
- DOCKER_HOST: "tcp://0.0.0.0:2375",
39064
- DOCKER_TLS_CERTDIR: "",
39065
- DOCKER_DIR: ".",
39066
- DOCKER_DRIVER: "overlay2"
39067
- }), (0, exports.getDockerImageVariables)(context));
39070
+ DOCKER_DIR: "."
39071
+ }), getDockerBaseVariables()), (0, exports.getDockerImageVariables)(context));
39068
39072
  };
39069
39073
  exports.getDockerBuildVariables = getDockerBuildVariables;
39070
39074
  exports.DOCKER_BUILD_JOB_NAME = "🔨 docker";
@@ -39075,7 +39079,7 @@ var getDockerJobBaseProps = function (context) {
39075
39079
  name: "docker:20-dind",
39076
39080
  command: ["--tls=false"]
39077
39081
  }],
39078
- variables: (0, exports.getDockerBuildVariables)(context)
39082
+ variables: getDockerBaseVariables()
39079
39083
  };
39080
39084
  };
39081
39085
  exports.getDockerJobBaseProps = getDockerJobBaseProps;
@@ -39088,7 +39092,9 @@ var createDockerBuildJobBase = function (context, _a) {
39088
39092
  stage: "build"
39089
39093
  }, (0, exports.getDockerJobBaseProps)(context)), {
39090
39094
  script: script || []
39091
- }), def);
39095
+ }), {
39096
+ variables: (0, exports.getDockerBuildVariables)(context)
39097
+ }, def);
39092
39098
  };
39093
39099
  exports.createDockerBuildJobBase = createDockerBuildJobBase;
39094
39100
  exports.gitlabDockerLogin = "docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY";
@@ -40106,7 +40112,7 @@ exports.readConfigSync = readConfigSync;
40106
40112
 
40107
40113
  exports.__esModule = true;
40108
40114
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
40109
- exports.PIPELINE_IMAGE_TAG = "refactor-gitlab-jobs-9e285eaf" || 0;
40115
+ exports.PIPELINE_IMAGE_TAG = "refactor-gitlab-jobs-c23038ea" || 0;
40110
40116
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
40111
40117
 
40112
40118
  /***/ }),
@@ -42340,33 +42346,36 @@ var kubeEnv_1 = __nccwpck_require__(9449);
42340
42346
  var mongodb_1 = __nccwpck_require__(7601);
42341
42347
  var processSecretsAsFiles_1 = __nccwpck_require__(5187);
42342
42348
  var createAppConfig = function (context, application) {
42343
- var _a, _b, _c;
42344
42349
  if (application === false) {
42345
42350
  return {
42346
42351
  enabled: false
42347
42352
  };
42348
42353
  }
42354
+ var _a = application !== null && application !== void 0 ? application : {},
42355
+ healthRoute = _a.healthRoute,
42356
+ command = _a.command,
42357
+ rest = __rest(_a, ["healthRoute", "command"]);
42349
42358
  return (0, utils_1.mergeWithMergingArrays)({
42350
42359
  host: context.environment.host,
42351
- command: context.componentConfig.build.startCommand,
42360
+ command: command !== null && command !== void 0 ? command : context.componentConfig.build.startCommand,
42352
42361
  livenessProbe: {
42353
42362
  httpGet: {
42354
- path: (_a = application === null || application === void 0 ? void 0 : application.healthRoute) !== null && _a !== void 0 ? _a : "__health"
42363
+ path: healthRoute !== null && healthRoute !== void 0 ? healthRoute : "__health"
42355
42364
  }
42356
42365
  },
42357
42366
  readinessProbe: {
42358
42367
  httpGet: {
42359
- path: (_b = application === null || application === void 0 ? void 0 : application.healthRoute) !== null && _b !== void 0 ? _b : "__health"
42368
+ path: healthRoute !== null && healthRoute !== void 0 ? healthRoute : "__health"
42360
42369
  }
42361
42370
  },
42362
42371
  startupProbe: {
42363
42372
  httpGet: {
42364
- path: (_c = application === null || application === void 0 ? void 0 : application.healthRoute) !== null && _c !== void 0 ? _c : "__health"
42373
+ path: healthRoute !== null && healthRoute !== void 0 ? healthRoute : "__health"
42365
42374
  }
42366
42375
  }
42367
42376
  },
42368
42377
  // default
42369
- application // merge rest in
42378
+ rest // merge rest in
42370
42379
  );
42371
42380
  };
42372
42381
 
@@ -43808,27 +43817,31 @@ var makeGitlabJob = function (componentName, env, _a, allJobs) {
43808
43817
  needs = _a.needs,
43809
43818
  job = __rest(_a, ["envMode", "needsStages", "needsOtherComponent", "name", "needs"]);
43810
43819
  var stage = envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(env) : job.stage;
43811
- var cleanedNeeds = __spreadArray(__spreadArray([], __read(needs !== null && needs !== void 0 ? needs : []), false), __read(needsOtherComponent !== null && needsOtherComponent !== void 0 ? needsOtherComponent : []), false);
43812
- var gitlabNeedsFromNeeds = cleanedNeeds === null || cleanedNeeds === void 0 ? void 0 : cleanedNeeds.map(function (n) {
43813
- var _a;
43814
- return (0, lodash_1.isObject)(n) ? {
43815
- job: getFullReferencedJobName(n.job, (_a = n.componentName) !== null && _a !== void 0 ? _a : componentName, env, allJobs),
43816
- artifacts: n.artifacts
43817
- } : getFullReferencedJobName(n, componentName, env, allJobs);
43818
- });
43819
- var gitlabNeedsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap(function (n) {
43820
- var _a, _b;
43821
- return (_b = (_a = allJobs[componentName]) === null || _a === void 0 ? void 0 : _a[env]) === null || _b === void 0 ? void 0 : _b.filter(function (j) {
43820
+ var needsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap(function (n) {
43821
+ var _a, _b, _c, _d;
43822
+ var referencedComponentName = componentName;
43823
+ var allJobNamesFromThatStage = (_d = (_c = (_b = (_a = allJobs[referencedComponentName]) === null || _a === void 0 ? void 0 : _a[env]) === null || _b === void 0 ? void 0 : _b.filter(function (j) {
43822
43824
  return j.stage === n.stage;
43823
- }).map(function (j) {
43825
+ })) === null || _c === void 0 ? void 0 : _c.map(function (j) {
43826
+ return j.name;
43827
+ })) !== null && _d !== void 0 ? _d : [];
43828
+ return allJobNamesFromThatStage.map(function (job) {
43824
43829
  var _a;
43825
43830
  return {
43826
- job: getFullReferencedJobName(j.name, componentName, env, allJobs),
43827
- artifacts: (_a = n.artifacts) !== null && _a !== void 0 ? _a : false
43831
+ job: job,
43832
+ artifacts: (_a = n.artifacts) !== null && _a !== void 0 ? _a : false,
43833
+ componentName: referencedComponentName
43828
43834
  };
43829
43835
  });
43830
43836
  });
43831
- var gitlabNeeds = __spreadArray(__spreadArray([], __read(gitlabNeedsFromNeeds), false), __read(gitlabNeedsFromStages !== null && gitlabNeedsFromStages !== void 0 ? gitlabNeedsFromStages : []), false).sort(function (a, b) {
43837
+ var cleanedNeeds = __spreadArray(__spreadArray(__spreadArray([], __read(needs !== null && needs !== void 0 ? needs : []), false), __read(needsOtherComponent !== null && needsOtherComponent !== void 0 ? needsOtherComponent : []), false), __read(needsFromStages !== null && needsFromStages !== void 0 ? needsFromStages : []), false);
43838
+ var gitlabNeeds = cleanedNeeds === null || cleanedNeeds === void 0 ? void 0 : cleanedNeeds.map(function (n) {
43839
+ var _a;
43840
+ return (0, lodash_1.isObject)(n) ? {
43841
+ job: getFullReferencedJobName(n.job, (_a = n.componentName) !== null && _a !== void 0 ? _a : componentName, env, allJobs),
43842
+ artifacts: n.artifacts
43843
+ } : getFullReferencedJobName(n, componentName, env, allJobs);
43844
+ }).sort(function (a, b) {
43832
43845
  return getJobName(a).localeCompare(getJobName(b));
43833
43846
  });
43834
43847
  var fullJobName = getFullJobName(name, componentName, envMode !== "none" ? env : undefined);
@@ -350385,18 +350385,22 @@ var requiresDockerBuild = function (context) {
350385
350385
  return false;
350386
350386
  };
350387
350387
  exports.requiresDockerBuild = requiresDockerBuild;
350388
+ var getDockerBaseVariables = function () {
350389
+ return {
350390
+ DOCKER_HOST: "tcp://0.0.0.0:2375",
350391
+ DOCKER_TLS_CERTDIR: "",
350392
+ DOCKER_DRIVER: "overlay2",
350393
+ DOCKER_BUILDKIT: "1"
350394
+ };
350395
+ };
350388
350396
  var getDockerBuildVariables = function (context) {
350389
350397
  var _a, _b, _c, _d;
350390
- return __assign(__assign(__assign({}, DOCKER_RUNNER_BUILD_VARIABLES), {
350391
- DOCKER_BUILDKIT: "1",
350398
+ return __assign(__assign(__assign(__assign({}, DOCKER_RUNNER_BUILD_VARIABLES), {
350392
350399
  DOCKERFILE_ADDITIONS: (_b = (_a = context.componentConfig.build.docker) === null || _a === void 0 ? void 0 : _a.additionsBegin) === null || _b === void 0 ? void 0 : _b.join("\n"),
350393
350400
  DOCKERFILE_ADDITIONS_END: (_d = (_c = context.componentConfig.build.docker) === null || _c === void 0 ? void 0 : _c.additionsEnd) === null || _d === void 0 ? void 0 : _d.join("\n"),
350394
350401
  APP_DIR: context.componentConfig.dir,
350395
- DOCKER_HOST: "tcp://0.0.0.0:2375",
350396
- DOCKER_TLS_CERTDIR: "",
350397
- DOCKER_DIR: ".",
350398
- DOCKER_DRIVER: "overlay2"
350399
- }), (0, exports.getDockerImageVariables)(context));
350402
+ DOCKER_DIR: "."
350403
+ }), getDockerBaseVariables()), (0, exports.getDockerImageVariables)(context));
350400
350404
  };
350401
350405
  exports.getDockerBuildVariables = getDockerBuildVariables;
350402
350406
  exports.DOCKER_BUILD_JOB_NAME = "🔨 docker";
@@ -350407,7 +350411,7 @@ var getDockerJobBaseProps = function (context) {
350407
350411
  name: "docker:20-dind",
350408
350412
  command: ["--tls=false"]
350409
350413
  }],
350410
- variables: (0, exports.getDockerBuildVariables)(context)
350414
+ variables: getDockerBaseVariables()
350411
350415
  };
350412
350416
  };
350413
350417
  exports.getDockerJobBaseProps = getDockerJobBaseProps;
@@ -350420,7 +350424,9 @@ var createDockerBuildJobBase = function (context, _a) {
350420
350424
  stage: "build"
350421
350425
  }, (0, exports.getDockerJobBaseProps)(context)), {
350422
350426
  script: script || []
350423
- }), def);
350427
+ }), {
350428
+ variables: (0, exports.getDockerBuildVariables)(context)
350429
+ }, def);
350424
350430
  };
350425
350431
  exports.createDockerBuildJobBase = createDockerBuildJobBase;
350426
350432
  exports.gitlabDockerLogin = "docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY";
@@ -351438,7 +351444,7 @@ exports.readConfigSync = readConfigSync;
351438
351444
 
351439
351445
  exports.__esModule = true;
351440
351446
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
351441
- exports.PIPELINE_IMAGE_TAG = "refactor-gitlab-jobs-9e285eaf" || 0;
351447
+ exports.PIPELINE_IMAGE_TAG = "refactor-gitlab-jobs-c23038ea" || 0;
351442
351448
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
351443
351449
 
351444
351450
  /***/ }),
@@ -353672,33 +353678,36 @@ var kubeEnv_1 = __nccwpck_require__(19449);
353672
353678
  var mongodb_1 = __nccwpck_require__(77601);
353673
353679
  var processSecretsAsFiles_1 = __nccwpck_require__(45187);
353674
353680
  var createAppConfig = function (context, application) {
353675
- var _a, _b, _c;
353676
353681
  if (application === false) {
353677
353682
  return {
353678
353683
  enabled: false
353679
353684
  };
353680
353685
  }
353686
+ var _a = application !== null && application !== void 0 ? application : {},
353687
+ healthRoute = _a.healthRoute,
353688
+ command = _a.command,
353689
+ rest = __rest(_a, ["healthRoute", "command"]);
353681
353690
  return (0, utils_1.mergeWithMergingArrays)({
353682
353691
  host: context.environment.host,
353683
- command: context.componentConfig.build.startCommand,
353692
+ command: command !== null && command !== void 0 ? command : context.componentConfig.build.startCommand,
353684
353693
  livenessProbe: {
353685
353694
  httpGet: {
353686
- path: (_a = application === null || application === void 0 ? void 0 : application.healthRoute) !== null && _a !== void 0 ? _a : "__health"
353695
+ path: healthRoute !== null && healthRoute !== void 0 ? healthRoute : "__health"
353687
353696
  }
353688
353697
  },
353689
353698
  readinessProbe: {
353690
353699
  httpGet: {
353691
- path: (_b = application === null || application === void 0 ? void 0 : application.healthRoute) !== null && _b !== void 0 ? _b : "__health"
353700
+ path: healthRoute !== null && healthRoute !== void 0 ? healthRoute : "__health"
353692
353701
  }
353693
353702
  },
353694
353703
  startupProbe: {
353695
353704
  httpGet: {
353696
- path: (_c = application === null || application === void 0 ? void 0 : application.healthRoute) !== null && _c !== void 0 ? _c : "__health"
353705
+ path: healthRoute !== null && healthRoute !== void 0 ? healthRoute : "__health"
353697
353706
  }
353698
353707
  }
353699
353708
  },
353700
353709
  // default
353701
- application // merge rest in
353710
+ rest // merge rest in
353702
353711
  );
353703
353712
  };
353704
353713
 
@@ -355140,27 +355149,31 @@ var makeGitlabJob = function (componentName, env, _a, allJobs) {
355140
355149
  needs = _a.needs,
355141
355150
  job = __rest(_a, ["envMode", "needsStages", "needsOtherComponent", "name", "needs"]);
355142
355151
  var stage = envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(env) : job.stage;
355143
- var cleanedNeeds = __spreadArray(__spreadArray([], __read(needs !== null && needs !== void 0 ? needs : []), false), __read(needsOtherComponent !== null && needsOtherComponent !== void 0 ? needsOtherComponent : []), false);
355144
- var gitlabNeedsFromNeeds = cleanedNeeds === null || cleanedNeeds === void 0 ? void 0 : cleanedNeeds.map(function (n) {
355145
- var _a;
355146
- return (0, lodash_1.isObject)(n) ? {
355147
- job: getFullReferencedJobName(n.job, (_a = n.componentName) !== null && _a !== void 0 ? _a : componentName, env, allJobs),
355148
- artifacts: n.artifacts
355149
- } : getFullReferencedJobName(n, componentName, env, allJobs);
355150
- });
355151
- var gitlabNeedsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap(function (n) {
355152
- var _a, _b;
355153
- return (_b = (_a = allJobs[componentName]) === null || _a === void 0 ? void 0 : _a[env]) === null || _b === void 0 ? void 0 : _b.filter(function (j) {
355152
+ var needsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap(function (n) {
355153
+ var _a, _b, _c, _d;
355154
+ var referencedComponentName = componentName;
355155
+ var allJobNamesFromThatStage = (_d = (_c = (_b = (_a = allJobs[referencedComponentName]) === null || _a === void 0 ? void 0 : _a[env]) === null || _b === void 0 ? void 0 : _b.filter(function (j) {
355154
355156
  return j.stage === n.stage;
355155
- }).map(function (j) {
355157
+ })) === null || _c === void 0 ? void 0 : _c.map(function (j) {
355158
+ return j.name;
355159
+ })) !== null && _d !== void 0 ? _d : [];
355160
+ return allJobNamesFromThatStage.map(function (job) {
355156
355161
  var _a;
355157
355162
  return {
355158
- job: getFullReferencedJobName(j.name, componentName, env, allJobs),
355159
- artifacts: (_a = n.artifacts) !== null && _a !== void 0 ? _a : false
355163
+ job: job,
355164
+ artifacts: (_a = n.artifacts) !== null && _a !== void 0 ? _a : false,
355165
+ componentName: referencedComponentName
355160
355166
  };
355161
355167
  });
355162
355168
  });
355163
- var gitlabNeeds = __spreadArray(__spreadArray([], __read(gitlabNeedsFromNeeds), false), __read(gitlabNeedsFromStages !== null && gitlabNeedsFromStages !== void 0 ? gitlabNeedsFromStages : []), false).sort(function (a, b) {
355169
+ var cleanedNeeds = __spreadArray(__spreadArray(__spreadArray([], __read(needs !== null && needs !== void 0 ? needs : []), false), __read(needsOtherComponent !== null && needsOtherComponent !== void 0 ? needsOtherComponent : []), false), __read(needsFromStages !== null && needsFromStages !== void 0 ? needsFromStages : []), false);
355170
+ var gitlabNeeds = cleanedNeeds === null || cleanedNeeds === void 0 ? void 0 : cleanedNeeds.map(function (n) {
355171
+ var _a;
355172
+ return (0, lodash_1.isObject)(n) ? {
355173
+ job: getFullReferencedJobName(n.job, (_a = n.componentName) !== null && _a !== void 0 ? _a : componentName, env, allJobs),
355174
+ artifacts: n.artifacts
355175
+ } : getFullReferencedJobName(n, componentName, env, allJobs);
355176
+ }).sort(function (a, b) {
355164
355177
  return getJobName(a).localeCompare(getJobName(b));
355165
355178
  });
355166
355179
  var fullJobName = getFullJobName(name, componentName, envMode !== "none" ? env : undefined);