@catladder/cli 0.0.0-main-66ca1336 → 0.0.0-main-4dd17ee1
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.
- package/dist/bundles/catenv/index.js +48 -18
- package/dist/bundles/cli/index.js +48 -18
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -39370,7 +39370,7 @@ var cache_1 = __nccwpck_require__(4303);
|
|
|
39370
39370
|
var constants_2 = __nccwpck_require__(9284);
|
|
39371
39371
|
var yarn_1 = __nccwpck_require__(464);
|
|
39372
39372
|
var createNodeBuildJobs = function (context) {
|
|
39373
|
-
var _a, _b, _c, _d, _e;
|
|
39373
|
+
var _a, _b, _c, _d, _e, _f;
|
|
39374
39374
|
var buildConfig = context.componentConfig.build;
|
|
39375
39375
|
if (!(0, types_1.isOfBuildType)(buildConfig, "node", "node-static", "storybook")) {
|
|
39376
39376
|
throw new Error("deploy config is not node, node-static or storybook");
|
|
@@ -39378,13 +39378,14 @@ var createNodeBuildJobs = function (context) {
|
|
|
39378
39378
|
var yarnInstall = (0, yarn_1.getYarnInstall)(context);
|
|
39379
39379
|
var appBuildJob = buildConfig.buildCommand !== null ? (0, createBuildJob_1.createBuildJob)(context, {
|
|
39380
39380
|
variables: __assign({}, constants_2.NODE_RUNNER_BUILD_VARIABLES),
|
|
39381
|
-
cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context)), false), __read((0, cache_1.getNextCache)(context)), false),
|
|
39382
|
-
script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((
|
|
39381
|
+
cache: __spreadArray(__spreadArray(__spreadArray([], __read((_a = (0, utils_1.ensureArray)(buildConfig.jobCache)) !== null && _a !== void 0 ? _a : []), false), __read((0, cache_1.getNodeCache)(context)), false), __read((0, cache_1.getNextCache)(context)), false),
|
|
39382
|
+
script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((_b = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _b !== void 0 ? _b : []), false),
|
|
39383
39383
|
artifacts: {
|
|
39384
|
-
paths: __spreadArray([(0, path_1.join)(context.componentConfig.dir, "__build_info.json"), (0, path_1.join)(context.componentConfig.dir, "dist"), (0, path_1.join)(context.componentConfig.dir, ".next")], __read((
|
|
39384
|
+
paths: __spreadArray([(0, path_1.join)(context.componentConfig.dir, "__build_info.json"), (0, path_1.join)(context.componentConfig.dir, "dist"), (0, path_1.join)(context.componentConfig.dir, ".next")], __read((_d = (_c = buildConfig.artifactsPaths) === null || _c === void 0 ? void 0 : _c.map(function (path) {
|
|
39385
39385
|
return (0, path_1.join)(context.componentConfig.dir, path);
|
|
39386
|
-
})) !== null &&
|
|
39387
|
-
}
|
|
39386
|
+
})) !== null && _d !== void 0 ? _d : []), false)
|
|
39387
|
+
},
|
|
39388
|
+
jobTags: buildConfig.jobTags
|
|
39388
39389
|
}) : null;
|
|
39389
39390
|
return __spreadArray(__spreadArray([], __read(appBuildJob ? [appBuildJob] : []), false), __read((0, docker_1.requiresDockerBuild)(context) ? [(0, docker_1.createDockerBuildJobDefault)(context, {
|
|
39390
39391
|
script: [buildConfig.type === "node-static" || buildConfig.type === "storybook" ? "ensureNginxDockerfile" : "ensureNodeDockerfile"],
|
|
@@ -39392,9 +39393,9 @@ var createNodeBuildJobs = function (context) {
|
|
|
39392
39393
|
variables: {
|
|
39393
39394
|
// only required for non static
|
|
39394
39395
|
DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context),
|
|
39395
|
-
DOCKER_COPY_WORKSPACE_FILES: (
|
|
39396
|
+
DOCKER_COPY_WORKSPACE_FILES: (_f = (_e = context.packageManagerInfo) === null || _e === void 0 ? void 0 : _e.pathsToCopyInDocker.map(function (dir) {
|
|
39396
39397
|
return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir);
|
|
39397
|
-
})) === null ||
|
|
39398
|
+
})) === null || _f === void 0 ? void 0 : _f.join("\n")
|
|
39398
39399
|
},
|
|
39399
39400
|
needs: appBuildJob ? [constants_1.APP_BUILD_JOB_NAME] : []
|
|
39400
39401
|
})] : []), false);
|
|
@@ -39806,7 +39807,7 @@ var getYarnInstallCommand = function (context) {
|
|
|
39806
39807
|
return "yarn install --immutable";
|
|
39807
39808
|
};
|
|
39808
39809
|
var ensureNodeVersion = function (context) {
|
|
39809
|
-
return ["if [ -f
|
|
39810
|
+
return ["if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi", "if [ -f ./.nvmrc ]; then nvm install <<< .nvmrc; fi"];
|
|
39810
39811
|
};
|
|
39811
39812
|
exports.ensureNodeVersion = ensureNodeVersion;
|
|
39812
39813
|
var getYarnInstall = function (context) {
|
|
@@ -40231,7 +40232,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
40231
40232
|
|
|
40232
40233
|
exports.__esModule = true;
|
|
40233
40234
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
40234
|
-
exports.PIPELINE_IMAGE_TAG = "main-
|
|
40235
|
+
exports.PIPELINE_IMAGE_TAG = "main-4dd17ee1" || 0;
|
|
40235
40236
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
40236
40237
|
|
|
40237
40238
|
/***/ }),
|
|
@@ -40664,7 +40665,10 @@ var getEnvironmentVariables = function (config, componentName, env, commitInfo,
|
|
|
40664
40665
|
basePredefinedVariables = {
|
|
40665
40666
|
ENV_SHORT: env,
|
|
40666
40667
|
APP_DIR: envConfigRaw.dir,
|
|
40667
|
-
ENV_TYPE: envType
|
|
40668
|
+
ENV_TYPE: envType,
|
|
40669
|
+
BUILD_INFO_ID: commitInfo === null || commitInfo === void 0 ? void 0 : commitInfo.buildId,
|
|
40670
|
+
BUILD_INFO_BUILD_TIME: commitInfo === null || commitInfo === void 0 ? void 0 : commitInfo.buildTime,
|
|
40671
|
+
BUILD_INFO_CURRENT_VERSION: commitInfo === null || commitInfo === void 0 ? void 0 : commitInfo.currentVersion
|
|
40668
40672
|
};
|
|
40669
40673
|
if (envType === "local") {
|
|
40670
40674
|
devLocalConfig = envConfigRaw;
|
|
@@ -41281,10 +41285,10 @@ var DEPLOY_RUNNER_VARIABLES = {
|
|
|
41281
41285
|
KUBERNETES_CPU_REQUEST: "0.5",
|
|
41282
41286
|
KUBERNETES_CPU_LIMIT: "1",
|
|
41283
41287
|
KUBERNETES_MEMORY_REQUEST: "200Mi",
|
|
41284
|
-
KUBERNETES_MEMORY_LIMIT: "
|
|
41288
|
+
KUBERNETES_MEMORY_LIMIT: "200Mi"
|
|
41285
41289
|
};
|
|
41286
41290
|
var getBaseDeploymentJob = function (context) {
|
|
41287
|
-
var _a, _b, _c;
|
|
41291
|
+
var _a, _b, _c, _d;
|
|
41288
41292
|
var hasDocker = (0, docker_1.requiresDockerBuild)(context);
|
|
41289
41293
|
var isStoppable = (0, utils_1.contextIsStoppable)(context);
|
|
41290
41294
|
var autoStop = context.environment.envType === "review" ? "2 week" : context.environment.envType === "dev" ? "4 weeks" : undefined;
|
|
@@ -41320,11 +41324,12 @@ var getBaseDeploymentJob = function (context) {
|
|
|
41320
41324
|
}],
|
|
41321
41325
|
allow_failure: whenDeploy === "manual" ? true : false,
|
|
41322
41326
|
stage: "deploy",
|
|
41323
|
-
variables: __assign(__assign(__assign({}, DEPLOY_RUNNER_VARIABLES), context.environment.envVars), hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {}),
|
|
41327
|
+
variables: __assign(__assign(__assign(__assign({}, DEPLOY_RUNNER_VARIABLES), context.environment.envVars), hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {}), context.componentConfig.deploy ? (_d = context.componentConfig.deploy.extraVars) !== null && _d !== void 0 ? _d : {} : {}),
|
|
41324
41328
|
environment: __assign(__assign({}, context.environment.gitlabEnvironment), isStoppable ? {
|
|
41325
41329
|
on_stop: exports.STOP_JOB_NAME,
|
|
41326
41330
|
auto_stop_in: autoStop
|
|
41327
|
-
} : {})
|
|
41331
|
+
} : {}),
|
|
41332
|
+
jobTags: context.componentConfig.deploy ? context.componentConfig.deploy.jobTags : undefined
|
|
41328
41333
|
};
|
|
41329
41334
|
};
|
|
41330
41335
|
exports.getBaseDeploymentJob = getBaseDeploymentJob;
|
|
@@ -43025,7 +43030,7 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
43025
43030
|
}
|
|
43026
43031
|
};
|
|
43027
43032
|
exports.__esModule = true;
|
|
43028
|
-
exports.getBuildId = void 0;
|
|
43033
|
+
exports.getCurrentVersionString = exports.getBuildId = void 0;
|
|
43029
43034
|
var child_process_promise_1 = __nccwpck_require__(5763);
|
|
43030
43035
|
var getBuildId = function () {
|
|
43031
43036
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -43042,6 +43047,26 @@ var getBuildId = function () {
|
|
|
43042
43047
|
});
|
|
43043
43048
|
};
|
|
43044
43049
|
exports.getBuildId = getBuildId;
|
|
43050
|
+
// thx chat gpt
|
|
43051
|
+
/**
|
|
43052
|
+
* returns the last tagged version string Major.minor.patch
|
|
43053
|
+
* returns 0.0.0 if there is no tag
|
|
43054
|
+
*/
|
|
43055
|
+
var getCurrentVersionString = function () {
|
|
43056
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
43057
|
+
return __generator(this, function (_a) {
|
|
43058
|
+
switch (_a.label) {
|
|
43059
|
+
case 0:
|
|
43060
|
+
return [4 /*yield*/, (0, child_process_promise_1.exec)('latest_tag=$(git describe --tags --abbrev=0 2>/dev/null); if [ -z "$latest_tag" ]; then echo "0.0.0"; else echo "${latest_tag#v}"; fi | cut -d "." -f 1-3').then(function (s) {
|
|
43061
|
+
return s.stdout.trim();
|
|
43062
|
+
})];
|
|
43063
|
+
case 1:
|
|
43064
|
+
return [2 /*return*/, _a.sent()];
|
|
43065
|
+
}
|
|
43066
|
+
});
|
|
43067
|
+
});
|
|
43068
|
+
};
|
|
43069
|
+
exports.getCurrentVersionString = getCurrentVersionString;
|
|
43045
43070
|
|
|
43046
43071
|
/***/ }),
|
|
43047
43072
|
|
|
@@ -43183,7 +43208,10 @@ var getBaseCommitInfo = function () {
|
|
|
43183
43208
|
};
|
|
43184
43209
|
return [4 /*yield*/, (0, getBuildId_1.getBuildId)()];
|
|
43185
43210
|
case 1:
|
|
43186
|
-
|
|
43211
|
+
_a.buildId = _c.sent();
|
|
43212
|
+
return [4 /*yield*/, (0, getBuildId_1.getCurrentVersionString)()];
|
|
43213
|
+
case 2:
|
|
43214
|
+
return [2 /*return*/, (_a.currentVersion = _c.sent(), _a)];
|
|
43187
43215
|
}
|
|
43188
43216
|
});
|
|
43189
43217
|
});
|
|
@@ -44002,7 +44030,8 @@ var makeGitlabJob = function (componentName, env, _a, allJobs) {
|
|
|
44002
44030
|
needsOtherComponent = _a.needsOtherComponent,
|
|
44003
44031
|
name = _a.name,
|
|
44004
44032
|
needs = _a.needs,
|
|
44005
|
-
|
|
44033
|
+
jobTags = _a.jobTags,
|
|
44034
|
+
job = __rest(_a, ["envMode", "needsStages", "needsOtherComponent", "name", "needs", "jobTags"]);
|
|
44006
44035
|
var stage = envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(env) : job.stage;
|
|
44007
44036
|
var needsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap(function (n) {
|
|
44008
44037
|
var _a, _b, _c, _d;
|
|
@@ -44033,6 +44062,7 @@ var makeGitlabJob = function (componentName, env, _a, allJobs) {
|
|
|
44033
44062
|
});
|
|
44034
44063
|
var fullJobName = getFullJobName(name, componentName, envMode !== "none" ? env : undefined);
|
|
44035
44064
|
var gitlabJob = removeUndefined(__assign(__assign({}, job), {
|
|
44065
|
+
tags: jobTags,
|
|
44036
44066
|
stage: stage,
|
|
44037
44067
|
environment: ((_b = job.environment) === null || _b === void 0 ? void 0 : _b.on_stop) ? __assign(__assign({}, job.environment), {
|
|
44038
44068
|
on_stop: getFullReferencedJobName(job.environment.on_stop, componentName, env, allJobs)
|
|
@@ -350673,7 +350673,7 @@ var cache_1 = __nccwpck_require__(54303);
|
|
|
350673
350673
|
var constants_2 = __nccwpck_require__(69284);
|
|
350674
350674
|
var yarn_1 = __nccwpck_require__(10464);
|
|
350675
350675
|
var createNodeBuildJobs = function (context) {
|
|
350676
|
-
var _a, _b, _c, _d, _e;
|
|
350676
|
+
var _a, _b, _c, _d, _e, _f;
|
|
350677
350677
|
var buildConfig = context.componentConfig.build;
|
|
350678
350678
|
if (!(0, types_1.isOfBuildType)(buildConfig, "node", "node-static", "storybook")) {
|
|
350679
350679
|
throw new Error("deploy config is not node, node-static or storybook");
|
|
@@ -350681,13 +350681,14 @@ var createNodeBuildJobs = function (context) {
|
|
|
350681
350681
|
var yarnInstall = (0, yarn_1.getYarnInstall)(context);
|
|
350682
350682
|
var appBuildJob = buildConfig.buildCommand !== null ? (0, createBuildJob_1.createBuildJob)(context, {
|
|
350683
350683
|
variables: __assign({}, constants_2.NODE_RUNNER_BUILD_VARIABLES),
|
|
350684
|
-
cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context)), false), __read((0, cache_1.getNextCache)(context)), false),
|
|
350685
|
-
script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((
|
|
350684
|
+
cache: __spreadArray(__spreadArray(__spreadArray([], __read((_a = (0, utils_1.ensureArray)(buildConfig.jobCache)) !== null && _a !== void 0 ? _a : []), false), __read((0, cache_1.getNodeCache)(context)), false), __read((0, cache_1.getNextCache)(context)), false),
|
|
350685
|
+
script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((_b = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _b !== void 0 ? _b : []), false),
|
|
350686
350686
|
artifacts: {
|
|
350687
|
-
paths: __spreadArray([(0, path_1.join)(context.componentConfig.dir, "__build_info.json"), (0, path_1.join)(context.componentConfig.dir, "dist"), (0, path_1.join)(context.componentConfig.dir, ".next")], __read((
|
|
350687
|
+
paths: __spreadArray([(0, path_1.join)(context.componentConfig.dir, "__build_info.json"), (0, path_1.join)(context.componentConfig.dir, "dist"), (0, path_1.join)(context.componentConfig.dir, ".next")], __read((_d = (_c = buildConfig.artifactsPaths) === null || _c === void 0 ? void 0 : _c.map(function (path) {
|
|
350688
350688
|
return (0, path_1.join)(context.componentConfig.dir, path);
|
|
350689
|
-
})) !== null &&
|
|
350690
|
-
}
|
|
350689
|
+
})) !== null && _d !== void 0 ? _d : []), false)
|
|
350690
|
+
},
|
|
350691
|
+
jobTags: buildConfig.jobTags
|
|
350691
350692
|
}) : null;
|
|
350692
350693
|
return __spreadArray(__spreadArray([], __read(appBuildJob ? [appBuildJob] : []), false), __read((0, docker_1.requiresDockerBuild)(context) ? [(0, docker_1.createDockerBuildJobDefault)(context, {
|
|
350693
350694
|
script: [buildConfig.type === "node-static" || buildConfig.type === "storybook" ? "ensureNginxDockerfile" : "ensureNodeDockerfile"],
|
|
@@ -350695,9 +350696,9 @@ var createNodeBuildJobs = function (context) {
|
|
|
350695
350696
|
variables: {
|
|
350696
350697
|
// only required for non static
|
|
350697
350698
|
DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context),
|
|
350698
|
-
DOCKER_COPY_WORKSPACE_FILES: (
|
|
350699
|
+
DOCKER_COPY_WORKSPACE_FILES: (_f = (_e = context.packageManagerInfo) === null || _e === void 0 ? void 0 : _e.pathsToCopyInDocker.map(function (dir) {
|
|
350699
350700
|
return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir);
|
|
350700
|
-
})) === null ||
|
|
350701
|
+
})) === null || _f === void 0 ? void 0 : _f.join("\n")
|
|
350701
350702
|
},
|
|
350702
350703
|
needs: appBuildJob ? [constants_1.APP_BUILD_JOB_NAME] : []
|
|
350703
350704
|
})] : []), false);
|
|
@@ -351109,7 +351110,7 @@ var getYarnInstallCommand = function (context) {
|
|
|
351109
351110
|
return "yarn install --immutable";
|
|
351110
351111
|
};
|
|
351111
351112
|
var ensureNodeVersion = function (context) {
|
|
351112
|
-
return ["if [ -f
|
|
351113
|
+
return ["if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi", "if [ -f ./.nvmrc ]; then nvm install <<< .nvmrc; fi"];
|
|
351113
351114
|
};
|
|
351114
351115
|
exports.ensureNodeVersion = ensureNodeVersion;
|
|
351115
351116
|
var getYarnInstall = function (context) {
|
|
@@ -351534,7 +351535,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
351534
351535
|
|
|
351535
351536
|
exports.__esModule = true;
|
|
351536
351537
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
351537
|
-
exports.PIPELINE_IMAGE_TAG = "main-
|
|
351538
|
+
exports.PIPELINE_IMAGE_TAG = "main-4dd17ee1" || 0;
|
|
351538
351539
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
351539
351540
|
|
|
351540
351541
|
/***/ }),
|
|
@@ -351967,7 +351968,10 @@ var getEnvironmentVariables = function (config, componentName, env, commitInfo,
|
|
|
351967
351968
|
basePredefinedVariables = {
|
|
351968
351969
|
ENV_SHORT: env,
|
|
351969
351970
|
APP_DIR: envConfigRaw.dir,
|
|
351970
|
-
ENV_TYPE: envType
|
|
351971
|
+
ENV_TYPE: envType,
|
|
351972
|
+
BUILD_INFO_ID: commitInfo === null || commitInfo === void 0 ? void 0 : commitInfo.buildId,
|
|
351973
|
+
BUILD_INFO_BUILD_TIME: commitInfo === null || commitInfo === void 0 ? void 0 : commitInfo.buildTime,
|
|
351974
|
+
BUILD_INFO_CURRENT_VERSION: commitInfo === null || commitInfo === void 0 ? void 0 : commitInfo.currentVersion
|
|
351971
351975
|
};
|
|
351972
351976
|
if (envType === "local") {
|
|
351973
351977
|
devLocalConfig = envConfigRaw;
|
|
@@ -352584,10 +352588,10 @@ var DEPLOY_RUNNER_VARIABLES = {
|
|
|
352584
352588
|
KUBERNETES_CPU_REQUEST: "0.5",
|
|
352585
352589
|
KUBERNETES_CPU_LIMIT: "1",
|
|
352586
352590
|
KUBERNETES_MEMORY_REQUEST: "200Mi",
|
|
352587
|
-
KUBERNETES_MEMORY_LIMIT: "
|
|
352591
|
+
KUBERNETES_MEMORY_LIMIT: "200Mi"
|
|
352588
352592
|
};
|
|
352589
352593
|
var getBaseDeploymentJob = function (context) {
|
|
352590
|
-
var _a, _b, _c;
|
|
352594
|
+
var _a, _b, _c, _d;
|
|
352591
352595
|
var hasDocker = (0, docker_1.requiresDockerBuild)(context);
|
|
352592
352596
|
var isStoppable = (0, utils_1.contextIsStoppable)(context);
|
|
352593
352597
|
var autoStop = context.environment.envType === "review" ? "2 week" : context.environment.envType === "dev" ? "4 weeks" : undefined;
|
|
@@ -352623,11 +352627,12 @@ var getBaseDeploymentJob = function (context) {
|
|
|
352623
352627
|
}],
|
|
352624
352628
|
allow_failure: whenDeploy === "manual" ? true : false,
|
|
352625
352629
|
stage: "deploy",
|
|
352626
|
-
variables: __assign(__assign(__assign({}, DEPLOY_RUNNER_VARIABLES), context.environment.envVars), hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {}),
|
|
352630
|
+
variables: __assign(__assign(__assign(__assign({}, DEPLOY_RUNNER_VARIABLES), context.environment.envVars), hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {}), context.componentConfig.deploy ? (_d = context.componentConfig.deploy.extraVars) !== null && _d !== void 0 ? _d : {} : {}),
|
|
352627
352631
|
environment: __assign(__assign({}, context.environment.gitlabEnvironment), isStoppable ? {
|
|
352628
352632
|
on_stop: exports.STOP_JOB_NAME,
|
|
352629
352633
|
auto_stop_in: autoStop
|
|
352630
|
-
} : {})
|
|
352634
|
+
} : {}),
|
|
352635
|
+
jobTags: context.componentConfig.deploy ? context.componentConfig.deploy.jobTags : undefined
|
|
352631
352636
|
};
|
|
352632
352637
|
};
|
|
352633
352638
|
exports.getBaseDeploymentJob = getBaseDeploymentJob;
|
|
@@ -354328,7 +354333,7 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
354328
354333
|
}
|
|
354329
354334
|
};
|
|
354330
354335
|
exports.__esModule = true;
|
|
354331
|
-
exports.getBuildId = void 0;
|
|
354336
|
+
exports.getCurrentVersionString = exports.getBuildId = void 0;
|
|
354332
354337
|
var child_process_promise_1 = __nccwpck_require__(75763);
|
|
354333
354338
|
var getBuildId = function () {
|
|
354334
354339
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -354345,6 +354350,26 @@ var getBuildId = function () {
|
|
|
354345
354350
|
});
|
|
354346
354351
|
};
|
|
354347
354352
|
exports.getBuildId = getBuildId;
|
|
354353
|
+
// thx chat gpt
|
|
354354
|
+
/**
|
|
354355
|
+
* returns the last tagged version string Major.minor.patch
|
|
354356
|
+
* returns 0.0.0 if there is no tag
|
|
354357
|
+
*/
|
|
354358
|
+
var getCurrentVersionString = function () {
|
|
354359
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
354360
|
+
return __generator(this, function (_a) {
|
|
354361
|
+
switch (_a.label) {
|
|
354362
|
+
case 0:
|
|
354363
|
+
return [4 /*yield*/, (0, child_process_promise_1.exec)('latest_tag=$(git describe --tags --abbrev=0 2>/dev/null); if [ -z "$latest_tag" ]; then echo "0.0.0"; else echo "${latest_tag#v}"; fi | cut -d "." -f 1-3').then(function (s) {
|
|
354364
|
+
return s.stdout.trim();
|
|
354365
|
+
})];
|
|
354366
|
+
case 1:
|
|
354367
|
+
return [2 /*return*/, _a.sent()];
|
|
354368
|
+
}
|
|
354369
|
+
});
|
|
354370
|
+
});
|
|
354371
|
+
};
|
|
354372
|
+
exports.getCurrentVersionString = getCurrentVersionString;
|
|
354348
354373
|
|
|
354349
354374
|
/***/ }),
|
|
354350
354375
|
|
|
@@ -354486,7 +354511,10 @@ var getBaseCommitInfo = function () {
|
|
|
354486
354511
|
};
|
|
354487
354512
|
return [4 /*yield*/, (0, getBuildId_1.getBuildId)()];
|
|
354488
354513
|
case 1:
|
|
354489
|
-
|
|
354514
|
+
_a.buildId = _c.sent();
|
|
354515
|
+
return [4 /*yield*/, (0, getBuildId_1.getCurrentVersionString)()];
|
|
354516
|
+
case 2:
|
|
354517
|
+
return [2 /*return*/, (_a.currentVersion = _c.sent(), _a)];
|
|
354490
354518
|
}
|
|
354491
354519
|
});
|
|
354492
354520
|
});
|
|
@@ -355305,7 +355333,8 @@ var makeGitlabJob = function (componentName, env, _a, allJobs) {
|
|
|
355305
355333
|
needsOtherComponent = _a.needsOtherComponent,
|
|
355306
355334
|
name = _a.name,
|
|
355307
355335
|
needs = _a.needs,
|
|
355308
|
-
|
|
355336
|
+
jobTags = _a.jobTags,
|
|
355337
|
+
job = __rest(_a, ["envMode", "needsStages", "needsOtherComponent", "name", "needs", "jobTags"]);
|
|
355309
355338
|
var stage = envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(env) : job.stage;
|
|
355310
355339
|
var needsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap(function (n) {
|
|
355311
355340
|
var _a, _b, _c, _d;
|
|
@@ -355336,6 +355365,7 @@ var makeGitlabJob = function (componentName, env, _a, allJobs) {
|
|
|
355336
355365
|
});
|
|
355337
355366
|
var fullJobName = getFullJobName(name, componentName, envMode !== "none" ? env : undefined);
|
|
355338
355367
|
var gitlabJob = removeUndefined(__assign(__assign({}, job), {
|
|
355368
|
+
tags: jobTags,
|
|
355339
355369
|
stage: stage,
|
|
355340
355370
|
environment: ((_b = job.environment) === null || _b === void 0 ? void 0 : _b.on_stop) ? __assign(__assign({}, job.environment), {
|
|
355341
355371
|
on_stop: getFullReferencedJobName(job.environment.on_stop, componentName, env, allJobs)
|