@catladder/cli 0.0.0-refactor-gitlab-jobs-c23038ea → 0.0.0-remove-undefined-66ca1336
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/apps/cli/commands/project/commandCloudSqlProxy.js +22 -62
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -1
- package/dist/apps/cli/commands/project/commandConfigSecrets.js +15 -4
- package/dist/apps/cli/commands/project/commandConfigSecrets.js.map +1 -1
- package/dist/apps/cli/commands/project/commandGetShell.js +9 -6
- package/dist/apps/cli/commands/project/commandGetShell.js.map +1 -1
- package/dist/apps/cli/commands/project/setup/setupContext.js +3 -10
- package/dist/apps/cli/commands/project/setup/setupContext.js.map +1 -1
- package/dist/apps/cli/commands/project/setup/setupKubernetes.js +16 -5
- package/dist/apps/cli/commands/project/setup/setupKubernetes.js.map +1 -1
- package/dist/apps/cli/verify/migration/migrateSecrets.js +3 -1
- package/dist/apps/cli/verify/migration/migrateSecrets.js.map +1 -1
- package/dist/bundles/catenv/index.js +321 -78
- package/dist/bundles/cli/index.js +731 -517
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +18 -43
- package/src/apps/cli/commands/project/commandConfigSecrets.ts +16 -2
- package/src/apps/cli/commands/project/commandGetShell.ts +8 -5
- package/src/apps/cli/commands/project/setup/setupContext.ts +2 -5
- package/src/apps/cli/commands/project/setup/setupKubernetes.ts +27 -6
- package/src/apps/cli/verify/migration/migrateSecrets.ts +6 -1
- package/dist/apps/cli/commands/project/setup/setupCloudSQL.d.ts +0 -3
- package/dist/apps/cli/commands/project/setup/setupCloudSQL.js +0 -56
- package/dist/apps/cli/commands/project/setup/setupCloudSQL.js.map +0 -1
- package/src/apps/cli/commands/project/setup/setupCloudSQL.ts +0 -22
|
@@ -38952,13 +38952,131 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
38952
38952
|
exports.__esModule = true;
|
|
38953
38953
|
exports.createCustomJobs = void 0;
|
|
38954
38954
|
var buildJob_1 = __nccwpck_require__(2644);
|
|
38955
|
+
var testJob_1 = __nccwpck_require__(2253);
|
|
38955
38956
|
var createCustomJobs = function (context) {
|
|
38956
|
-
return __spreadArray([], __read((0, buildJob_1.createCustomBuildJobs)(context)), false);
|
|
38957
|
+
return __spreadArray(__spreadArray([], __read((0, testJob_1.createCustomTestJobs)(context)), false), __read((0, buildJob_1.createCustomBuildJobs)(context)), false);
|
|
38957
38958
|
};
|
|
38958
38959
|
exports.createCustomJobs = createCustomJobs;
|
|
38959
38960
|
|
|
38960
38961
|
/***/ }),
|
|
38961
38962
|
|
|
38963
|
+
/***/ 2253:
|
|
38964
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
38965
|
+
|
|
38966
|
+
"use strict";
|
|
38967
|
+
|
|
38968
|
+
|
|
38969
|
+
var __assign = this && this.__assign || function () {
|
|
38970
|
+
__assign = Object.assign || function (t) {
|
|
38971
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
38972
|
+
s = arguments[i];
|
|
38973
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
38974
|
+
}
|
|
38975
|
+
return t;
|
|
38976
|
+
};
|
|
38977
|
+
return __assign.apply(this, arguments);
|
|
38978
|
+
};
|
|
38979
|
+
var __read = this && this.__read || function (o, n) {
|
|
38980
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
38981
|
+
if (!m) return o;
|
|
38982
|
+
var i = m.call(o),
|
|
38983
|
+
r,
|
|
38984
|
+
ar = [],
|
|
38985
|
+
e;
|
|
38986
|
+
try {
|
|
38987
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
38988
|
+
} catch (error) {
|
|
38989
|
+
e = {
|
|
38990
|
+
error: error
|
|
38991
|
+
};
|
|
38992
|
+
} finally {
|
|
38993
|
+
try {
|
|
38994
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
38995
|
+
} finally {
|
|
38996
|
+
if (e) throw e.error;
|
|
38997
|
+
}
|
|
38998
|
+
}
|
|
38999
|
+
return ar;
|
|
39000
|
+
};
|
|
39001
|
+
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
39002
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
39003
|
+
if (ar || !(i in from)) {
|
|
39004
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
39005
|
+
ar[i] = from[i];
|
|
39006
|
+
}
|
|
39007
|
+
}
|
|
39008
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
39009
|
+
};
|
|
39010
|
+
exports.__esModule = true;
|
|
39011
|
+
exports.createCustomTestJobs = void 0;
|
|
39012
|
+
var path_1 = __nccwpck_require__(1017);
|
|
39013
|
+
var utils_1 = __nccwpck_require__(7461);
|
|
39014
|
+
var types_1 = __nccwpck_require__(1197);
|
|
39015
|
+
var RUNNER_CUSTOM_TEST_VARIABLES = {
|
|
39016
|
+
KUBERNETES_CPU_REQUEST: "0.5",
|
|
39017
|
+
KUBERNETES_CPU_LIMIT: "2",
|
|
39018
|
+
KUBERNETES_MEMORY_REQUEST: "2Gi",
|
|
39019
|
+
KUBERNETES_MEMORY_LIMIT: "4Gi"
|
|
39020
|
+
};
|
|
39021
|
+
var createCustomTestJobs = function (context) {
|
|
39022
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
39023
|
+
// don't run tests after release
|
|
39024
|
+
if (((_a = context.commitInfo) === null || _a === void 0 ? void 0 : _a.trigger) === "taggedRelease") {
|
|
39025
|
+
return [];
|
|
39026
|
+
}
|
|
39027
|
+
var buildConfig = context.componentConfig.build;
|
|
39028
|
+
if (!(0, types_1.isOfBuildType)(buildConfig, "custom")) {
|
|
39029
|
+
throw new Error("deploy config is not custom");
|
|
39030
|
+
}
|
|
39031
|
+
var base = {
|
|
39032
|
+
variables: __assign(__assign({
|
|
39033
|
+
APP_PATH: context.componentConfig.dir
|
|
39034
|
+
}, RUNNER_CUSTOM_TEST_VARIABLES), (_b = buildConfig.extraVars) !== null && _b !== void 0 ? _b : {}),
|
|
39035
|
+
services: buildConfig.jobServices,
|
|
39036
|
+
cache: buildConfig.jobCache,
|
|
39037
|
+
stage: "test",
|
|
39038
|
+
needs: [],
|
|
39039
|
+
envMode: "none"
|
|
39040
|
+
};
|
|
39041
|
+
var auditJob = buildConfig.audit ? __assign(__assign(__assign({
|
|
39042
|
+
name: "🛡 audit"
|
|
39043
|
+
}, base), {
|
|
39044
|
+
image: (_d = (_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.jobImage) !== null && _d !== void 0 ? _d : buildConfig.jobImage,
|
|
39045
|
+
cache: undefined,
|
|
39046
|
+
script: __spreadArray([], __read((_f = (0, utils_1.ensureArray)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : []), false),
|
|
39047
|
+
allow_failure: true
|
|
39048
|
+
}), createArtifactsConfig(context.componentConfig.dir, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifactsReports)) : null;
|
|
39049
|
+
var lintJob = buildConfig.lint ? __assign(__assign(__assign({
|
|
39050
|
+
name: "👮 lint"
|
|
39051
|
+
}, base), {
|
|
39052
|
+
image: (_j = (_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.jobImage) !== null && _j !== void 0 ? _j : buildConfig.jobImage,
|
|
39053
|
+
script: __spreadArray([], __read((_l = (0, utils_1.ensureArray)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : []), false)
|
|
39054
|
+
}), createArtifactsConfig(context.componentConfig.dir, (_m = buildConfig.lint) === null || _m === void 0 ? void 0 : _m.artifactsReports)) : null;
|
|
39055
|
+
var testJob = buildConfig.test ? __assign(__assign(__assign({
|
|
39056
|
+
name: "🧪 test"
|
|
39057
|
+
}, base), {
|
|
39058
|
+
image: (_p = (_o = buildConfig.test) === null || _o === void 0 ? void 0 : _o.jobImage) !== null && _p !== void 0 ? _p : buildConfig.jobImage,
|
|
39059
|
+
script: __spreadArray([], __read((_r = (0, utils_1.ensureArray)((_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.command)) !== null && _r !== void 0 ? _r : []), false)
|
|
39060
|
+
}), createArtifactsConfig(context.componentConfig.dir, (_s = buildConfig.test) === null || _s === void 0 ? void 0 : _s.artifactsReports)) : null;
|
|
39061
|
+
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
39062
|
+
};
|
|
39063
|
+
exports.createCustomTestJobs = createCustomTestJobs;
|
|
39064
|
+
var createArtifactsConfig = function (rootPath, artifactsReports) {
|
|
39065
|
+
var _a, _b;
|
|
39066
|
+
return artifactsReports ? {
|
|
39067
|
+
artifacts: {
|
|
39068
|
+
paths: [],
|
|
39069
|
+
reports: {
|
|
39070
|
+
junit: (_b = (_a = artifactsReports === null || artifactsReports === void 0 ? void 0 : artifactsReports.junit) === null || _a === void 0 ? void 0 : _a.map(function (p) {
|
|
39071
|
+
return (0, path_1.join)(rootPath, p);
|
|
39072
|
+
})) !== null && _b !== void 0 ? _b : []
|
|
39073
|
+
}
|
|
39074
|
+
}
|
|
39075
|
+
} : undefined;
|
|
39076
|
+
};
|
|
39077
|
+
|
|
39078
|
+
/***/ }),
|
|
39079
|
+
|
|
38962
39080
|
/***/ 3219:
|
|
38963
39081
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
38964
39082
|
|
|
@@ -39273,13 +39391,7 @@ var createNodeBuildJobs = function (context) {
|
|
|
39273
39391
|
cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context, "pull")), false),
|
|
39274
39392
|
variables: {
|
|
39275
39393
|
// only required for non static
|
|
39276
|
-
|
|
39277
|
-
prodOnly: true
|
|
39278
|
-
}),
|
|
39279
|
-
YARN_INSTALL_WITHOUT_SCRIPTS: (0, yarn_1.getYarnInstallCommand)(context, {
|
|
39280
|
-
prodOnly: true,
|
|
39281
|
-
noScripts: true
|
|
39282
|
-
}),
|
|
39394
|
+
DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context),
|
|
39283
39395
|
DOCKER_COPY_WORKSPACE_FILES: (_e = (_d = context.packageManagerInfo) === null || _d === void 0 ? void 0 : _d.pathsToCopyInDocker.map(function (dir) {
|
|
39284
39396
|
return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir);
|
|
39285
39397
|
})) === null || _e === void 0 ? void 0 : _e.join("\n")
|
|
@@ -39682,31 +39794,43 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
39682
39794
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
39683
39795
|
};
|
|
39684
39796
|
exports.__esModule = true;
|
|
39685
|
-
exports.
|
|
39686
|
-
var
|
|
39797
|
+
exports.getDockerAppCopyAndBuildScript = exports.getYarnInstall = exports.ensureNodeVersion = void 0;
|
|
39798
|
+
var YARN_INSTALL_CLASSIC = "yarn install --frozen-lockfile";
|
|
39799
|
+
// FIXME: check why and when rebuild is needed
|
|
39800
|
+
var YARN_BERRY_PROD_REBUILD = "yarn workspaces focus --production && yarn rebuild";
|
|
39801
|
+
var getYarnInstallCommand = function (context) {
|
|
39687
39802
|
var _a;
|
|
39688
39803
|
if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
|
|
39689
|
-
return
|
|
39804
|
+
return YARN_INSTALL_CLASSIC;
|
|
39690
39805
|
}
|
|
39691
|
-
|
|
39692
|
-
// yarn >= 4 ships with build in plugins, see https://github.com/yarnpkg/berry/pull/4253
|
|
39693
|
-
// trying to import those fail on this version
|
|
39694
|
-
var doesNotShipWithBuiltInPlugins = ["2", "3"].some(function (v) {
|
|
39695
|
-
var _a;
|
|
39696
|
-
return (_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.version.startsWith(v);
|
|
39697
|
-
});
|
|
39698
|
-
return (options === null || options === void 0 ? void 0 : options.prodOnly) ? "".concat((options === null || options === void 0 ? void 0 : options.noScripts) ? "YARN_ENABLE_SCRIPTS=false " : "").concat(doesNotShipWithBuiltInPlugins ? "yarn plugin import workspace-tools && " : " ", "yarn workspaces focus --production && yarn rebuild") // needs yarn plugin import workspace-tools
|
|
39699
|
-
: "".concat((options === null || options === void 0 ? void 0 : options.noScripts) ? "YARN_ENABLE_SCRIPTS=false " : "", "yarn install --immutable");
|
|
39806
|
+
return "yarn install --immutable";
|
|
39700
39807
|
};
|
|
39701
|
-
exports.getYarnInstallCommand = getYarnInstallCommand;
|
|
39702
39808
|
var ensureNodeVersion = function (context) {
|
|
39703
39809
|
return ["if [ -f ./.nvmrc ]; then source /root/.nvm/nvm.sh && nvm install <<< .nvmrc; fi"];
|
|
39704
39810
|
};
|
|
39705
39811
|
exports.ensureNodeVersion = ensureNodeVersion;
|
|
39706
39812
|
var getYarnInstall = function (context) {
|
|
39707
|
-
return __spreadArray(__spreadArray([], __read((0, exports.ensureNodeVersion)(context)), false), [
|
|
39813
|
+
return __spreadArray(__spreadArray([], __read((0, exports.ensureNodeVersion)(context)), false), [getYarnInstallCommand(context)], false);
|
|
39708
39814
|
};
|
|
39709
39815
|
exports.getYarnInstall = getYarnInstall;
|
|
39816
|
+
var DOCKER_COPY_FILES = "COPY --chown=node:node $APP_DIR .";
|
|
39817
|
+
var getDockerAppCopyAndBuildScript = function (context) {
|
|
39818
|
+
var _a;
|
|
39819
|
+
if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
|
|
39820
|
+
return "\nRUN ".concat(YARN_INSTALL_CLASSIC, " --production --ignore-scripts\n").concat(DOCKER_COPY_FILES, "\nRUN ").concat(YARN_INSTALL_CLASSIC, " --production \n ").trim();
|
|
39821
|
+
}
|
|
39822
|
+
// yarn >= 4 ships with build in plugins, see https://github.com/yarnpkg/berry/pull/4253
|
|
39823
|
+
// trying to import those fail on this version
|
|
39824
|
+
var doesNotShipWithBuiltInPlugins = ["2", "3"].some(function (v) {
|
|
39825
|
+
var _a;
|
|
39826
|
+
return (_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.version.startsWith(v);
|
|
39827
|
+
});
|
|
39828
|
+
var maybeAddWorkspaceToolsCommand = doesNotShipWithBuiltInPlugins ? "RUN yarn plugin import workspace-tools" : "";
|
|
39829
|
+
// copy first everything and then install
|
|
39830
|
+
// rebuild first does not work as it will run postinstall and that might require files in the app
|
|
39831
|
+
return "\n".concat(DOCKER_COPY_FILES, "\n").concat(maybeAddWorkspaceToolsCommand, "\nRUN ").concat(YARN_BERRY_PROD_REBUILD, "\n\n ").trim();
|
|
39832
|
+
};
|
|
39833
|
+
exports.getDockerAppCopyAndBuildScript = getDockerAppCopyAndBuildScript;
|
|
39710
39834
|
|
|
39711
39835
|
/***/ }),
|
|
39712
39836
|
|
|
@@ -39743,29 +39867,25 @@ exports.createRailsBuildJobs = void 0;
|
|
|
39743
39867
|
var types_1 = __nccwpck_require__(1197);
|
|
39744
39868
|
var docker_1 = __nccwpck_require__(3219);
|
|
39745
39869
|
var createRailsBuildJobs = function (context) {
|
|
39746
|
-
var _a, _b, _c
|
|
39870
|
+
var _a, _b, _c;
|
|
39747
39871
|
var buildConfig = context.componentConfig.build;
|
|
39748
39872
|
if (!(0, types_1.isOfBuildType)(buildConfig, "rails")) {
|
|
39749
39873
|
// should not happen
|
|
39750
39874
|
throw new Error("build type is not rails");
|
|
39751
39875
|
}
|
|
39752
39876
|
var cnbConf = buildConfig.cnbBuilder;
|
|
39753
|
-
|
|
39754
|
-
// TODO: remove when all projects are migrated
|
|
39755
|
-
var packEnvArgs = (_c = (_b = (_a = buildConfig.extraVars) === null || _a === void 0 ? void 0 : _a.CNB_ENV_VARS) === null || _b === void 0 ? void 0 : _b.split(" ").map(function (v) {
|
|
39756
|
-
return "--env '".concat(v, "'");
|
|
39757
|
-
})) !== null && _c !== void 0 ? _c : Object.entries((_d = cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.buildVars) !== null && _d !== void 0 ? _d : {}).map(function (_a) {
|
|
39877
|
+
var packEnvArgs = Object.entries((_a = cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.buildVars) !== null && _a !== void 0 ? _a : {}).map(function (_a) {
|
|
39758
39878
|
var _b = __read(_a, 2),
|
|
39759
39879
|
k = _b[0],
|
|
39760
39880
|
v = _b[1];
|
|
39761
39881
|
return "--env '".concat(k).concat(v ? "=".concat(v) : "", "'");
|
|
39762
|
-
});
|
|
39882
|
+
}).join(" ");
|
|
39763
39883
|
return [(0, docker_1.createDockerBuildJobBase)(context, {
|
|
39764
39884
|
variables: context.componentConfig.build.extraVars,
|
|
39765
39885
|
// custom script
|
|
39766
39886
|
script: [docker_1.gitlabDockerLogin, "docker pull $DOCKER_CACHE_IMAGE || true", "wget --output-document=- https://github.com/buildpacks/pack/releases/download/v".concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packVersion, "/pack-v").concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packVersion, "-linux.tgz | tar -zx --directory /usr/local/bin pack"), "chmod +x /usr/local/bin/pack",
|
|
39767
39887
|
// replace private git ssh gem sources with https to make bundler with credentials via env var work
|
|
39768
|
-
"sed --in-place 's|git@\\([^:]*\\):|https://\\1/|g' Gemfile Gemfile.lock", "pack build \"$DOCKER_IMAGE:$DOCKER_IMAGE_TAG\" --builder '".concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.image, "' --publish --cache-image \"$DOCKER_CACHE_IMAGE\" ").concat(packEnvArgs
|
|
39888
|
+
"sed --in-place 's|git@\\([^:]*\\):|https://\\1/|g' Gemfile Gemfile.lock", "pack build \"$DOCKER_IMAGE:$DOCKER_IMAGE_TAG\" --builder '".concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.image, "' --publish --cache-image \"$DOCKER_CACHE_IMAGE\" ").concat(packEnvArgs, " ").concat((_c = (_b = cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packExtraArgs) === null || _b === void 0 ? void 0 : _b.join(" ")) !== null && _c !== void 0 ? _c : "")]
|
|
39769
39889
|
})];
|
|
39770
39890
|
};
|
|
39771
39891
|
exports.createRailsBuildJobs = createRailsBuildJobs;
|
|
@@ -39889,9 +40009,8 @@ var createRailsTestJobs = function (context) {
|
|
|
39889
40009
|
var bundlerCache = {
|
|
39890
40010
|
key: {
|
|
39891
40011
|
files: ["Gemfile.lock"],
|
|
39892
|
-
prefix: "$CI_JOB_IMAGE"
|
|
40012
|
+
prefix: "$CI_JOB_IMAGE"
|
|
39893
40013
|
},
|
|
39894
|
-
|
|
39895
40014
|
paths: [bundlerCacheDir]
|
|
39896
40015
|
};
|
|
39897
40016
|
var auditJob = buildConfig.audit !== false ? __assign(__assign({
|
|
@@ -40112,7 +40231,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
40112
40231
|
|
|
40113
40232
|
exports.__esModule = true;
|
|
40114
40233
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
40115
|
-
exports.PIPELINE_IMAGE_TAG = "
|
|
40234
|
+
exports.PIPELINE_IMAGE_TAG = "remove-undefined-66ca1336" || 0;
|
|
40116
40235
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
40117
40236
|
|
|
40118
40237
|
/***/ }),
|
|
@@ -40569,8 +40688,13 @@ var getEnvironmentVariables = function (config, componentName, env, commitInfo,
|
|
|
40569
40688
|
}
|
|
40570
40689
|
publicEnvVarsRaw = (_e = (_d = envConfigRaw.vars) === null || _d === void 0 ? void 0 : _d.public) !== null && _e !== void 0 ? _e : {};
|
|
40571
40690
|
additionalSecretKeys = deployConfigRaw ? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].additionalSecretKeys(environmentContext) : [];
|
|
40572
|
-
secretEnvVarKeys = __spreadArray(__spreadArray([], __read((_g = (_f = envConfigRaw.vars) === null || _f === void 0 ? void 0 : _f.secret) !== null && _g !== void 0 ? _g : [])
|
|
40573
|
-
|
|
40691
|
+
secretEnvVarKeys = __spreadArray(__spreadArray([], __read(((_g = (_f = envConfigRaw.vars) === null || _f === void 0 ? void 0 : _f.secret) !== null && _g !== void 0 ? _g : []).map(function (key) {
|
|
40692
|
+
return {
|
|
40693
|
+
key: key
|
|
40694
|
+
};
|
|
40695
|
+
})), false), __read(additionalSecretKeys), false);
|
|
40696
|
+
secretEnvVars = Object.fromEntries(secretEnvVarKeys.map(function (_a) {
|
|
40697
|
+
var key = _a.key;
|
|
40574
40698
|
return [key, "$".concat((0, exports.getSecretVarName)(env, componentName, key))];
|
|
40575
40699
|
}));
|
|
40576
40700
|
legacyFromComponents = (_j = (_h = envConfigRaw.vars) === null || _h === void 0 ? void 0 : _h.fromComponents) !== null && _j !== void 0 ? _j : {};
|
|
@@ -41425,6 +41549,7 @@ var createGoogleCloudRunDeployJobs = function (context) {
|
|
|
41425
41549
|
};
|
|
41426
41550
|
var getCreateScheduleScripts = function () {
|
|
41427
41551
|
return jobsWithSchedule.map(function (_a) {
|
|
41552
|
+
var _b;
|
|
41428
41553
|
var job = _a.job,
|
|
41429
41554
|
jobName = _a.jobName,
|
|
41430
41555
|
schedulerName = _a.schedulerName;
|
|
@@ -41432,6 +41557,7 @@ var createGoogleCloudRunDeployJobs = function (context) {
|
|
|
41432
41557
|
project: deployConfig.projectId,
|
|
41433
41558
|
location: deployConfig.region,
|
|
41434
41559
|
schedule: "\"".concat(job.schedule, "\""),
|
|
41560
|
+
"max-retry-attempts": (_b = job.maxRetryAttempts) !== null && _b !== void 0 ? _b : 0,
|
|
41435
41561
|
uri: "\"https://".concat(deployConfig.region, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(deployConfig.projectId, "/jobs/").concat(jobName, ":run\""),
|
|
41436
41562
|
"http-method": "POST",
|
|
41437
41563
|
"oauth-service-account-email": "$GCLOUD_PROJECT_NUMBER-compute@developer.gserviceaccount.com"
|
|
@@ -41447,13 +41573,15 @@ var createGoogleCloudRunDeployJobs = function (context) {
|
|
|
41447
41573
|
});
|
|
41448
41574
|
return jobsWithSchedule.map(function (_a) {
|
|
41449
41575
|
var schedulerName = _a.schedulerName;
|
|
41450
|
-
return
|
|
41576
|
+
return ["gcloud scheduler jobs delete ".concat(schedulerName, " ").concat(argsString)];
|
|
41451
41577
|
}).flat();
|
|
41452
41578
|
};
|
|
41453
41579
|
var getDeleteJobsScripts = function () {
|
|
41454
|
-
return jobsWithNames.
|
|
41580
|
+
return jobsWithNames.flatMap(function (_a) {
|
|
41455
41581
|
var jobName = _a.jobName;
|
|
41456
|
-
return
|
|
41582
|
+
return [
|
|
41583
|
+
// first delete all job executions. Otherwise delete might fail if one of those is still running
|
|
41584
|
+
"gcloud beta run jobs executions list ".concat(commonArgsString, " --job ").concat(jobName, " --format=\"value(name)\" | xargs -I {} gcloud beta run jobs executions delete {} --quiet ").concat(commonArgsString), "gcloud beta run jobs delete ".concat(jobName, " ").concat(commonArgsString)];
|
|
41457
41585
|
});
|
|
41458
41586
|
};
|
|
41459
41587
|
var deployScripts = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read(setExtraVarsScripts(deployConfig)), false), __read(pushImageToArtifactsRegistry), false), ["echo \"$ENV_VARS\" > ____envvars.yaml"], false), __read(deployConfig.cloudSql ? (0, database_1.getDatabaseCreateScript)(context, deployConfig) // we create the db, so that we can also delete it afterwards
|
|
@@ -41487,7 +41615,7 @@ var createGoogleCloudRunDeployJobs = function (context) {
|
|
|
41487
41615
|
variables: {
|
|
41488
41616
|
CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
|
|
41489
41617
|
},
|
|
41490
|
-
script: stopScripts
|
|
41618
|
+
script: (0, gitlab_1.allowFailureInScripts)(stopScripts)
|
|
41491
41619
|
})];
|
|
41492
41620
|
};
|
|
41493
41621
|
exports.createGoogleCloudRunDeployJobs = createGoogleCloudRunDeployJobs;
|
|
@@ -41545,20 +41673,21 @@ exports.__esModule = true;
|
|
|
41545
41673
|
exports.GCLOUD_RUN_DEPLOY_TYPE = exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = void 0;
|
|
41546
41674
|
var context_1 = __nccwpck_require__(2041);
|
|
41547
41675
|
var gitlab_1 = __nccwpck_require__(4997);
|
|
41676
|
+
var utils_1 = __nccwpck_require__(463);
|
|
41548
41677
|
var deployJob_1 = __nccwpck_require__(2256);
|
|
41549
41678
|
var jobName_1 = __nccwpck_require__(7311);
|
|
41550
41679
|
exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = "GCLOUD_DEPLOY_credentialsKey";
|
|
41551
41680
|
exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = "GCLOUD_RUN_canonicalHostSuffix";
|
|
41552
41681
|
var getCloudSqlVariables = function (_a) {
|
|
41553
|
-
var _b, _c
|
|
41682
|
+
var _b, _c;
|
|
41554
41683
|
var deployConfigRaw = _a.deployConfigRaw,
|
|
41555
41684
|
environmentSlugPrefix = _a.environmentSlugPrefix,
|
|
41556
41685
|
env = _a.env,
|
|
41557
41686
|
componentName = _a.componentName,
|
|
41558
41687
|
fullConfig = _a.fullConfig;
|
|
41559
41688
|
if (deployConfigRaw && deployConfigRaw.cloudSql) {
|
|
41560
|
-
var DB_NAME =
|
|
41561
|
-
var additionalQueryParamsString = Object.entries((
|
|
41689
|
+
var DB_NAME = (0, utils_1.getFullDbName)(deployConfigRaw.cloudSql, fullConfig, environmentSlugPrefix, componentName);
|
|
41690
|
+
var additionalQueryParamsString = Object.entries((_b = deployConfigRaw.cloudSql.dbAdditionalQueryParams) !== null && _b !== void 0 ? _b : {}).map(function (_a) {
|
|
41562
41691
|
var _b = __read(_a, 2),
|
|
41563
41692
|
key = _b[0],
|
|
41564
41693
|
value = _b[1];
|
|
@@ -41567,7 +41696,7 @@ var getCloudSqlVariables = function (_a) {
|
|
|
41567
41696
|
return {
|
|
41568
41697
|
CLOUD_SQL_INSTANCE_CONNECTION_NAME: deployConfigRaw.cloudSql.instanceConnectionName,
|
|
41569
41698
|
DB_NAME: DB_NAME,
|
|
41570
|
-
DB_USER: (
|
|
41699
|
+
DB_USER: (_c = deployConfigRaw.cloudSql.dbUser) !== null && _c !== void 0 ? _c : "postgres",
|
|
41571
41700
|
DB_PASSWORD: "$" + (0, context_1.getSecretVarName)(env, componentName, "DB_PASSWORD"),
|
|
41572
41701
|
DATABASE_URL: "postgresql://$DB_USER:$DB_PASSWORD@localhost/$DB_NAME?host=/cloudsql/$CLOUD_SQL_INSTANCE_CONNECTION_NAME".concat(additionalQueryParamsString),
|
|
41573
41702
|
DATABASE_JDBC_URL: "jdbc:postgresql:///$DB_NAME?cloudSqlInstance=$CLOUD_SQL_INSTANCE_CONNECTION_NAME&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=$DB_USER&password=$DB_PASSWORD".concat(additionalQueryParamsString)
|
|
@@ -41590,7 +41719,15 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
41590
41719
|
return {};
|
|
41591
41720
|
},
|
|
41592
41721
|
additionalSecretKeys: function (ctx) {
|
|
41593
|
-
return __spreadArray([
|
|
41722
|
+
return __spreadArray([{
|
|
41723
|
+
key: exports.GCLOUD_DEPLOY_CREDENTIALS_KEY,
|
|
41724
|
+
hidden: true
|
|
41725
|
+
}, {
|
|
41726
|
+
key: exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX,
|
|
41727
|
+
hidden: true
|
|
41728
|
+
}], __read(ctx.deployConfigRaw && ctx.deployConfigRaw.cloudSql ? [{
|
|
41729
|
+
key: "DB_PASSWORD"
|
|
41730
|
+
}] : []), false);
|
|
41594
41731
|
},
|
|
41595
41732
|
getAdditionalEnvVars: function (ctx) {
|
|
41596
41733
|
var _a;
|
|
@@ -41778,6 +41915,22 @@ exports.getCloudRunJobName = getCloudRunJobName;
|
|
|
41778
41915
|
|
|
41779
41916
|
/***/ }),
|
|
41780
41917
|
|
|
41918
|
+
/***/ 463:
|
|
41919
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
41920
|
+
|
|
41921
|
+
"use strict";
|
|
41922
|
+
|
|
41923
|
+
|
|
41924
|
+
exports.__esModule = true;
|
|
41925
|
+
exports.getFullDbName = void 0;
|
|
41926
|
+
var getFullDbName = function (cloudSqlConfig, fullConfig, environmentSlugPrefix, componentName) {
|
|
41927
|
+
var _a, _b;
|
|
41928
|
+
return [(_a = cloudSqlConfig.dbNamePrefix) !== null && _a !== void 0 ? _a : "".concat(fullConfig.customerName, "-").concat(fullConfig.appName), environmentSlugPrefix, (_b = cloudSqlConfig.dbBaseName) !== null && _b !== void 0 ? _b : componentName].filter(Boolean).join("-");
|
|
41929
|
+
};
|
|
41930
|
+
exports.getFullDbName = getFullDbName;
|
|
41931
|
+
|
|
41932
|
+
/***/ }),
|
|
41933
|
+
|
|
41781
41934
|
/***/ 6531:
|
|
41782
41935
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
41783
41936
|
|
|
@@ -41823,7 +41976,7 @@ var runner_1 = __nccwpck_require__(5071);
|
|
|
41823
41976
|
var base_1 = __nccwpck_require__(9177);
|
|
41824
41977
|
var types_1 = __nccwpck_require__(3109);
|
|
41825
41978
|
var createCustomDeployJobs = function (context) {
|
|
41826
|
-
var _a, _b;
|
|
41979
|
+
var _a, _b, _c;
|
|
41827
41980
|
var deployConfig = context.componentConfig.deploy;
|
|
41828
41981
|
if (deployConfig === false) {
|
|
41829
41982
|
return [];
|
|
@@ -41834,11 +41987,14 @@ var createCustomDeployJobs = function (context) {
|
|
|
41834
41987
|
}
|
|
41835
41988
|
var baseDeploymentJob = (0, base_1.getBaseDeploymentJob)(context);
|
|
41836
41989
|
var yarnInstall = (0, yarn_1.getYarnInstall)(context);
|
|
41837
|
-
return [(0, lodash_1.merge)({}, baseDeploymentJob, {
|
|
41990
|
+
return __spreadArray([(0, lodash_1.merge)({}, baseDeploymentJob, {
|
|
41838
41991
|
image: (_a = deployConfig.jobImage) !== null && _a !== void 0 ? _a : (0, runner_1.getRunnerImage)("jobs-default"),
|
|
41839
41992
|
cache: (_b = deployConfig.jobCache) !== null && _b !== void 0 ? _b : [],
|
|
41840
41993
|
script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(deployConfig.requiresYarnInstall ? yarnInstall : []), false), __read(deployConfig.script), false)
|
|
41841
|
-
})]
|
|
41994
|
+
})], __read(deployConfig.stopScript ? [(0, lodash_1.merge)({}, (0, base_1.getBaseDeploymentStopJob)(context), {
|
|
41995
|
+
image: (_c = deployConfig.jobImage) !== null && _c !== void 0 ? _c : (0, runner_1.getRunnerImage)("jobs-default"),
|
|
41996
|
+
script: deployConfig.stopScript
|
|
41997
|
+
})] : []), false);
|
|
41842
41998
|
};
|
|
41843
41999
|
exports.createCustomDeployJobs = createCustomDeployJobs;
|
|
41844
42000
|
|
|
@@ -41988,7 +42144,11 @@ var additionalKubernetesSecretKeys = function (_a) {
|
|
|
41988
42144
|
keys.push("POSTGRESQL_PASSWORD");
|
|
41989
42145
|
keys.push("cloudsqlProxyCredentials");
|
|
41990
42146
|
}
|
|
41991
|
-
return keys
|
|
42147
|
+
return keys.map(function (key) {
|
|
42148
|
+
return {
|
|
42149
|
+
key: key
|
|
42150
|
+
};
|
|
42151
|
+
});
|
|
41992
42152
|
};
|
|
41993
42153
|
exports.additionalKubernetesSecretKeys = additionalKubernetesSecretKeys;
|
|
41994
42154
|
|
|
@@ -42001,8 +42161,9 @@ exports.additionalKubernetesSecretKeys = additionalKubernetesSecretKeys;
|
|
|
42001
42161
|
|
|
42002
42162
|
|
|
42003
42163
|
exports.__esModule = true;
|
|
42004
|
-
exports.
|
|
42164
|
+
exports.createKubernetesCloudsqlBaseValues = exports.hasKubernetesCloudSQL = void 0;
|
|
42005
42165
|
var context_1 = __nccwpck_require__(2041);
|
|
42166
|
+
var utils_1 = __nccwpck_require__(463);
|
|
42006
42167
|
var types_1 = __nccwpck_require__(3109);
|
|
42007
42168
|
var hasKubernetesCloudSQL = function (context) {
|
|
42008
42169
|
var _a, _b;
|
|
@@ -42012,22 +42173,42 @@ var hasKubernetesCloudSQL = function (context) {
|
|
|
42012
42173
|
return false;
|
|
42013
42174
|
};
|
|
42014
42175
|
exports.hasKubernetesCloudSQL = hasKubernetesCloudSQL;
|
|
42015
|
-
var
|
|
42016
|
-
var _a;
|
|
42017
|
-
if ((0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
|
|
42018
|
-
|
|
42176
|
+
var createKubernetesCloudsqlBaseValues = function (context) {
|
|
42177
|
+
var _a, _b, _c, _d, _e;
|
|
42178
|
+
if (!(0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
|
|
42179
|
+
throw new Error("cannot get cloud sql config");
|
|
42180
|
+
}
|
|
42181
|
+
var config = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.cloudsql;
|
|
42182
|
+
if (!config) {
|
|
42183
|
+
throw new Error("cannot get cloud sql config");
|
|
42184
|
+
}
|
|
42185
|
+
var proxyCredentials = "$".concat((0, context_1.getSecretVarNameForContext)(context, "cloudsqlProxyCredentials"));
|
|
42186
|
+
if ((config === null || config === void 0 ? void 0 : config.type) !== "unmanaged") {
|
|
42187
|
+
var instanceConnectionName = "".concat((_b = config.projectId) !== null && _b !== void 0 ? _b : "skynet-164509", ":").concat((_c = config.region) !== null && _c !== void 0 ? _c : "europe-west6", ":").concat((_d = config.instanceId) !== null && _d !== void 0 ? _d : context.environment.envVars.KUBE_NAMESPACE);
|
|
42188
|
+
return {
|
|
42189
|
+
cloudsql: {
|
|
42190
|
+
enabled: config.enabled,
|
|
42191
|
+
dbUser: "postgres",
|
|
42192
|
+
instanceConnectionName: instanceConnectionName,
|
|
42193
|
+
proxyCredentials: proxyCredentials,
|
|
42194
|
+
fullDbName: context.environment.envVars.KUBE_APP_NAME
|
|
42195
|
+
}
|
|
42196
|
+
};
|
|
42197
|
+
} else if (config.type === "unmanaged") {
|
|
42198
|
+
return {
|
|
42199
|
+
cloudsql: {
|
|
42200
|
+
enabled: config.enabled,
|
|
42201
|
+
dbUser: (_e = config.dbUser) !== null && _e !== void 0 ? _e : "postgres",
|
|
42202
|
+
instanceConnectionName: config.instanceConnectionName,
|
|
42203
|
+
proxyCredentials: proxyCredentials,
|
|
42204
|
+
fullDbName: (0, utils_1.getFullDbName)(config, context.fullConfig, context.environment.slugPrefix, context.componentName)
|
|
42205
|
+
}
|
|
42206
|
+
};
|
|
42207
|
+
} else {
|
|
42208
|
+
throw new Error("unknonw type");
|
|
42019
42209
|
}
|
|
42020
|
-
throw new Error("cannot get cloud sql config");
|
|
42021
|
-
};
|
|
42022
|
-
exports.getKubernetesCloudSQLConfig = getKubernetesCloudSQLConfig;
|
|
42023
|
-
var createCloudsqlBaseConfig = function (context) {
|
|
42024
|
-
return {
|
|
42025
|
-
cloudsql: {
|
|
42026
|
-
proxyCredentials: "$".concat((0, context_1.getSecretVarNameForContext)(context, "cloudsqlProxyCredentials"))
|
|
42027
|
-
}
|
|
42028
|
-
};
|
|
42029
42210
|
};
|
|
42030
|
-
exports.
|
|
42211
|
+
exports.createKubernetesCloudsqlBaseValues = createKubernetesCloudsqlBaseValues;
|
|
42031
42212
|
|
|
42032
42213
|
/***/ }),
|
|
42033
42214
|
|
|
@@ -42410,7 +42591,7 @@ var createKubeValues = function (context) {
|
|
|
42410
42591
|
var defaultKubeValues = (0, lodash_1.merge)({
|
|
42411
42592
|
env: env,
|
|
42412
42593
|
application: createAppConfig(context, application)
|
|
42413
|
-
}, (0, cloudSql_1.hasKubernetesCloudSQL)(context) ? (0, cloudSql_1.
|
|
42594
|
+
}, (0, cloudSql_1.hasKubernetesCloudSQL)(context) ? (0, cloudSql_1.createKubernetesCloudsqlBaseValues)(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) : {});
|
|
42414
42595
|
var kubeValues = (0, processSecretsAsFiles_1.processSecretsAsFiles)((0, utils_1.mergeWithMergingArrays)(defaultKubeValues, __assign({
|
|
42415
42596
|
jobs: removeFalsy(jobs),
|
|
42416
42597
|
cronjobs: removeFalsy(cronjobs)
|
|
@@ -43557,6 +43738,7 @@ exports.__esModule = true;
|
|
|
43557
43738
|
exports.createJobsForComponent = void 0;
|
|
43558
43739
|
var lodash_1 = __nccwpck_require__(3255);
|
|
43559
43740
|
var build_1 = __nccwpck_require__(3760);
|
|
43741
|
+
var reporting_1 = __nccwpck_require__(3545);
|
|
43560
43742
|
var context_1 = __nccwpck_require__(2041);
|
|
43561
43743
|
var deploy_1 = __nccwpck_require__(223);
|
|
43562
43744
|
var getCommitInfo_1 = __nccwpck_require__(5923);
|
|
@@ -43579,13 +43761,11 @@ var getCustomJobs = function (context) {
|
|
|
43579
43761
|
return injectDefaultVarsInCustomJobs(context, rawJobs);
|
|
43580
43762
|
};
|
|
43581
43763
|
var createRawJobs = function (context) {
|
|
43582
|
-
if (context.componentConfig.deploy === false) {
|
|
43583
|
-
return [];
|
|
43584
|
-
}
|
|
43585
43764
|
var buildJobs = build_1.BUILD_TYPES[context.componentConfig.build.type].jobs(context);
|
|
43586
|
-
var deployJobs = deploy_1.DEPLOY_TYPES[context.componentConfig.deploy.type].jobs(context);
|
|
43765
|
+
var deployJobs = context.componentConfig.deploy !== false ? deploy_1.DEPLOY_TYPES[context.componentConfig.deploy.type].jobs(context) : [];
|
|
43766
|
+
var reportingJobs = (0, reporting_1.createReportingJobs)(context);
|
|
43587
43767
|
var customJobs = getCustomJobs(context);
|
|
43588
|
-
return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
|
|
43768
|
+
return __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(reportingJobs), false), __read(customJobs), false);
|
|
43589
43769
|
};
|
|
43590
43770
|
var createJobsForComponent = function (config, componentName, env, trigger) {
|
|
43591
43771
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -43788,6 +43968,13 @@ exports.__esModule = true;
|
|
|
43788
43968
|
exports.createGitlabJobs = exports.makeGitlabJob = void 0;
|
|
43789
43969
|
var lodash_1 = __nccwpck_require__(3255);
|
|
43790
43970
|
var defaults_1 = __nccwpck_require__(7383);
|
|
43971
|
+
var removeUndefined = function (obj) {
|
|
43972
|
+
return Object.fromEntries(Object.entries(obj).filter(function (_a) {
|
|
43973
|
+
var _b = __read(_a, 2),
|
|
43974
|
+
value = _b[1];
|
|
43975
|
+
return value !== undefined;
|
|
43976
|
+
}));
|
|
43977
|
+
};
|
|
43791
43978
|
var getFullJobName = function (name, componentName, env) {
|
|
43792
43979
|
if (env) {
|
|
43793
43980
|
return "".concat(componentName, " ").concat(name, " | ").concat(env, " ");
|
|
@@ -43845,7 +44032,7 @@ var makeGitlabJob = function (componentName, env, _a, allJobs) {
|
|
|
43845
44032
|
return getJobName(a).localeCompare(getJobName(b));
|
|
43846
44033
|
});
|
|
43847
44034
|
var fullJobName = getFullJobName(name, componentName, envMode !== "none" ? env : undefined);
|
|
43848
|
-
var gitlabJob = __assign(__assign({}, job), {
|
|
44035
|
+
var gitlabJob = removeUndefined(__assign(__assign({}, job), {
|
|
43849
44036
|
stage: stage,
|
|
43850
44037
|
environment: ((_b = job.environment) === null || _b === void 0 ? void 0 : _b.on_stop) ? __assign(__assign({}, job.environment), {
|
|
43851
44038
|
on_stop: getFullReferencedJobName(job.environment.on_stop, componentName, env, allJobs)
|
|
@@ -43854,7 +44041,7 @@ var makeGitlabJob = function (componentName, env, _a, allJobs) {
|
|
|
43854
44041
|
needs: gitlabNeeds,
|
|
43855
44042
|
retry: defaults_1.BASE_RETRY,
|
|
43856
44043
|
interruptible: true
|
|
43857
|
-
});
|
|
44044
|
+
}));
|
|
43858
44045
|
return [fullJobName, gitlabJob];
|
|
43859
44046
|
};
|
|
43860
44047
|
exports.makeGitlabJob = makeGitlabJob;
|
|
@@ -44068,7 +44255,7 @@ var path_equal_1 = __nccwpck_require__(4843);
|
|
|
44068
44255
|
var yarnUtils_1 = __nccwpck_require__(1369);
|
|
44069
44256
|
var getPackageManagerInfo = function (config, componentName) {
|
|
44070
44257
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
44071
|
-
var version, isClassic, component, workspaces, currentWorkspace, componentIsInWorkspace, workspaceRoot, packageJson, workspacePackageJson, lockFile, configFiles,
|
|
44258
|
+
var version, isClassic, component, workspaces, currentWorkspace, componentIsInWorkspace, workspaceRoot, packageJson, workspacePackageJson, lockFile, configFiles, configFilePaths, workspaceDependencies, pathsToCopyInDocker;
|
|
44072
44259
|
return __generator(this, function (_a) {
|
|
44073
44260
|
switch (_a.label) {
|
|
44074
44261
|
case 0:
|
|
@@ -44090,9 +44277,9 @@ var getPackageManagerInfo = function (config, componentName) {
|
|
|
44090
44277
|
workspacePackageJson = componentIsInWorkspace ? (0, path_1.join)(workspaceRoot, "package.json") : null;
|
|
44091
44278
|
lockFile = componentIsInWorkspace ? (0, path_1.join)(workspaceRoot, "yarn.lock") : (0, path_1.join)(component.dir, "yarn.lock");
|
|
44092
44279
|
configFiles = [".yarnrc", ".yarnrc.yml", ".npmrc", ".yarn"];
|
|
44093
|
-
|
|
44280
|
+
configFilePaths = __spreadArray(__spreadArray([], __read(configFiles), false), __read(configFiles.map(function (f) {
|
|
44094
44281
|
return (0, path_1.join)(component.dir, f);
|
|
44095
|
-
})).filter(function (f) {
|
|
44282
|
+
})), false).filter(function (f) {
|
|
44096
44283
|
return (0, fs_1.existsSync)(f);
|
|
44097
44284
|
});
|
|
44098
44285
|
workspaceDependencies = currentWorkspace ? __spreadArray(__spreadArray([], __read(currentWorkspace.workspaceDependencies), false), __read(currentWorkspace.mismatchedWorkspaceDependencies), false).map(function (name) {
|
|
@@ -44101,7 +44288,7 @@ var getPackageManagerInfo = function (config, componentName) {
|
|
|
44101
44288
|
return w.name === name;
|
|
44102
44289
|
})) === null || _a === void 0 ? void 0 : _a.location;
|
|
44103
44290
|
}).filter(Boolean) : [];
|
|
44104
|
-
pathsToCopyInDocker = __spreadArray(__spreadArray(__spreadArray(__spreadArray([packageJson], __read(workspacePackageJson ? [workspacePackageJson] : []), false), [lockFile], false), __read(
|
|
44291
|
+
pathsToCopyInDocker = __spreadArray(__spreadArray(__spreadArray(__spreadArray([packageJson], __read(workspacePackageJson ? [workspacePackageJson] : []), false), [lockFile], false), __read(configFilePaths), false), __read(workspaceDependencies), false);
|
|
44105
44292
|
return [2 /*return*/, {
|
|
44106
44293
|
type: "yarn",
|
|
44107
44294
|
workspaces: workspaces,
|
|
@@ -44326,7 +44513,7 @@ exports.getWorkspaces = (0, memoizee_1["default"])(function (isClassic) {
|
|
|
44326
44513
|
|
|
44327
44514
|
|
|
44328
44515
|
exports.__esModule = true;
|
|
44329
|
-
exports.RULES_RELEASE = exports.RULE_CONDITION_MAIN_BRANCH = exports.RULES_ALWAYS = exports.RULE_NEVER_ON_RELEASE_COMMIT = void 0;
|
|
44516
|
+
exports.RULES_RELEASE = exports.RULE_CONDITION_HOTFIX_BRANCH = exports.RULE_CONDITION_MAIN_BRANCH = exports.RULES_ALWAYS = exports.RULE_NEVER_ON_RELEASE_COMMIT = void 0;
|
|
44330
44517
|
exports.RULE_NEVER_ON_RELEASE_COMMIT = {
|
|
44331
44518
|
"if": "$CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/",
|
|
44332
44519
|
when: "never"
|
|
@@ -44341,6 +44528,7 @@ exports.RULES_ALWAYS = [{
|
|
|
44341
44528
|
"if": "$CI_MERGE_REQUEST_ID"
|
|
44342
44529
|
}];
|
|
44343
44530
|
exports.RULE_CONDITION_MAIN_BRANCH = "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH";
|
|
44531
|
+
exports.RULE_CONDITION_HOTFIX_BRANCH = "$CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/";
|
|
44344
44532
|
exports.RULES_RELEASE = [exports.RULE_NEVER_ON_RELEASE_COMMIT, {
|
|
44345
44533
|
"if": exports.RULE_CONDITION_MAIN_BRANCH + ' && $AUTO_RELEASE == "true"',
|
|
44346
44534
|
when: "on_success"
|
|
@@ -44348,7 +44536,7 @@ exports.RULES_RELEASE = [exports.RULE_NEVER_ON_RELEASE_COMMIT, {
|
|
|
44348
44536
|
"if": exports.RULE_CONDITION_MAIN_BRANCH,
|
|
44349
44537
|
when: "manual"
|
|
44350
44538
|
}, {
|
|
44351
|
-
"if":
|
|
44539
|
+
"if": exports.RULE_CONDITION_HOTFIX_BRANCH,
|
|
44352
44540
|
when: "manual"
|
|
44353
44541
|
}];
|
|
44354
44542
|
|
|
@@ -44567,7 +44755,7 @@ var sanitizeForBashVariable = function (name) {
|
|
|
44567
44755
|
};
|
|
44568
44756
|
exports.sanitizeForBashVariable = sanitizeForBashVariable;
|
|
44569
44757
|
var repeatOnFailure = function (command, options) {
|
|
44570
|
-
return "\n until ".concat(command, "
|
|
44758
|
+
return "\n until ".concat(command, "\n do\n echo \"Trying again.\"\n sleep ").concat(options.pauseInSeconds, "\n done\n ");
|
|
44571
44759
|
};
|
|
44572
44760
|
exports.repeatOnFailure = repeatOnFailure;
|
|
44573
44761
|
|
|
@@ -44631,6 +44819,61 @@ exports.mergeWithMergingArrays = mergeWithMergingArrays;
|
|
|
44631
44819
|
|
|
44632
44820
|
/***/ }),
|
|
44633
44821
|
|
|
44822
|
+
/***/ 3545:
|
|
44823
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
44824
|
+
|
|
44825
|
+
"use strict";
|
|
44826
|
+
|
|
44827
|
+
|
|
44828
|
+
exports.__esModule = true;
|
|
44829
|
+
exports.createReportingJobs = void 0;
|
|
44830
|
+
var base_1 = __nccwpck_require__(9177);
|
|
44831
|
+
var utils_1 = __nccwpck_require__(7461);
|
|
44832
|
+
var STAGE = "verify";
|
|
44833
|
+
var SBOM_GENERATE_JOB_NAME = "🧾 sbom";
|
|
44834
|
+
var SBOM_FILE = "__sbom.json";
|
|
44835
|
+
var createSbomGenerateJob = function (context) {
|
|
44836
|
+
var _a, _b, _c, _d, _e;
|
|
44837
|
+
var buildConfig = context.componentConfig.build;
|
|
44838
|
+
var defaultImage = "aquasec/trivy:0.38.3";
|
|
44839
|
+
var defaultScript = ["trivy fs --quiet --format cyclonedx --output \"".concat(SBOM_FILE, "\" ").concat(((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.componentIsInWorkspace) ? "." : context.componentConfig.dir)];
|
|
44840
|
+
var image = buildConfig.type === "custom" && buildConfig.sbom !== false ? (_c = (_b = buildConfig.sbom) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : defaultImage : defaultImage;
|
|
44841
|
+
var script = buildConfig.type === "custom" && buildConfig.sbom !== false ? (_e = (0, utils_1.ensureArray)((_d = buildConfig.sbom) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : defaultScript : defaultScript;
|
|
44842
|
+
return {
|
|
44843
|
+
name: SBOM_GENERATE_JOB_NAME,
|
|
44844
|
+
stage: STAGE,
|
|
44845
|
+
needs: context.componentConfig.deploy !== false ? [base_1.DEPLOY_JOB_NAME] : [],
|
|
44846
|
+
envMode: "jobPerEnv",
|
|
44847
|
+
variables: {},
|
|
44848
|
+
cache: undefined,
|
|
44849
|
+
image: image,
|
|
44850
|
+
script: script,
|
|
44851
|
+
allow_failure: true,
|
|
44852
|
+
artifacts: {
|
|
44853
|
+
paths: [SBOM_FILE]
|
|
44854
|
+
}
|
|
44855
|
+
};
|
|
44856
|
+
};
|
|
44857
|
+
var createSbomUploadJob = function (context) {
|
|
44858
|
+
return {
|
|
44859
|
+
name: "🧾 sbom upload",
|
|
44860
|
+
stage: STAGE,
|
|
44861
|
+
needs: [SBOM_GENERATE_JOB_NAME],
|
|
44862
|
+
envMode: "jobPerEnv",
|
|
44863
|
+
variables: {},
|
|
44864
|
+
cache: undefined,
|
|
44865
|
+
image: "git.panter.ch:5001/open-source/dependency-track-uploader:dtrackuploader-v0.2.1",
|
|
44866
|
+
script: ["/dtrackuploader https://dep.panter.dev/ \"$DT_KEY\" upload \"".concat(context.fullConfig.customerName, "-").concat(context.fullConfig.appName, "/").concat(context.componentName, "\" \"").concat(context.environment.shortName, "\" \"").concat(SBOM_FILE, "\" vex.json")],
|
|
44867
|
+
allow_failure: true
|
|
44868
|
+
};
|
|
44869
|
+
};
|
|
44870
|
+
var createReportingJobs = function (context) {
|
|
44871
|
+
return context.componentConfig.build.type === "custom" && context.componentConfig.build.sbom === false ? [] : [createSbomGenerateJob(context), createSbomUploadJob(context)];
|
|
44872
|
+
};
|
|
44873
|
+
exports.createReportingJobs = createReportingJobs;
|
|
44874
|
+
|
|
44875
|
+
/***/ }),
|
|
44876
|
+
|
|
44634
44877
|
/***/ 9904:
|
|
44635
44878
|
/***/ ((module) => {
|
|
44636
44879
|
|