@catladder/cli 0.0.0-main-bc2a3387 โ 0.0.0-main-03e0177e
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 +57 -37
- package/dist/bundles/cli/index.js +57 -37
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -39009,6 +39009,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
39009
39009
|
};
|
|
39010
39010
|
exports.__esModule = true;
|
|
39011
39011
|
exports.createCustomTestJobs = void 0;
|
|
39012
|
+
var path_1 = __nccwpck_require__(1017);
|
|
39012
39013
|
var utils_1 = __nccwpck_require__(7461);
|
|
39013
39014
|
var types_1 = __nccwpck_require__(1197);
|
|
39014
39015
|
var RUNNER_CUSTOM_TEST_VARIABLES = {
|
|
@@ -39018,7 +39019,7 @@ var RUNNER_CUSTOM_TEST_VARIABLES = {
|
|
|
39018
39019
|
KUBERNETES_MEMORY_LIMIT: "4Gi"
|
|
39019
39020
|
};
|
|
39020
39021
|
var createCustomTestJobs = function (context) {
|
|
39021
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
39022
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
39022
39023
|
// don't run tests after release
|
|
39023
39024
|
if (((_a = context.commitInfo) === null || _a === void 0 ? void 0 : _a.trigger) === "taggedRelease") {
|
|
39024
39025
|
return [];
|
|
@@ -39037,29 +39038,42 @@ var createCustomTestJobs = function (context) {
|
|
|
39037
39038
|
needs: [],
|
|
39038
39039
|
envMode: "none"
|
|
39039
39040
|
};
|
|
39040
|
-
var auditJob = buildConfig.audit ? __assign(__assign({
|
|
39041
|
+
var auditJob = buildConfig.audit ? __assign(__assign(__assign({
|
|
39041
39042
|
name: "๐ก audit"
|
|
39042
39043
|
}, base), {
|
|
39043
39044
|
image: (_d = (_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.jobImage) !== null && _d !== void 0 ? _d : buildConfig.jobImage,
|
|
39044
39045
|
cache: undefined,
|
|
39045
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),
|
|
39046
39047
|
allow_failure: true
|
|
39047
|
-
}) : null;
|
|
39048
|
-
var lintJob = buildConfig.lint ? __assign(__assign({
|
|
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({
|
|
39049
39050
|
name: "๐ฎ lint"
|
|
39050
39051
|
}, base), {
|
|
39051
|
-
image: (
|
|
39052
|
-
script: __spreadArray([], __read((
|
|
39053
|
-
}) : null;
|
|
39054
|
-
var testJob = buildConfig.test ? __assign(__assign({
|
|
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({
|
|
39055
39056
|
name: "๐งช test"
|
|
39056
39057
|
}, base), {
|
|
39057
|
-
image: (
|
|
39058
|
-
script: __spreadArray([], __read((
|
|
39059
|
-
}) : null;
|
|
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;
|
|
39060
39061
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
39061
39062
|
};
|
|
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
|
+
};
|
|
39063
39077
|
|
|
39064
39078
|
/***/ }),
|
|
39065
39079
|
|
|
@@ -39377,13 +39391,7 @@ var createNodeBuildJobs = function (context) {
|
|
|
39377
39391
|
cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context, "pull")), false),
|
|
39378
39392
|
variables: {
|
|
39379
39393
|
// only required for non static
|
|
39380
|
-
|
|
39381
|
-
prodOnly: true
|
|
39382
|
-
}),
|
|
39383
|
-
YARN_INSTALL_WITHOUT_SCRIPTS: (0, yarn_1.getYarnInstallCommand)(context, {
|
|
39384
|
-
prodOnly: true,
|
|
39385
|
-
noScripts: true
|
|
39386
|
-
}),
|
|
39394
|
+
DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context),
|
|
39387
39395
|
DOCKER_COPY_WORKSPACE_FILES: (_e = (_d = context.packageManagerInfo) === null || _d === void 0 ? void 0 : _d.pathsToCopyInDocker.map(function (dir) {
|
|
39388
39396
|
return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir);
|
|
39389
39397
|
})) === null || _e === void 0 ? void 0 : _e.join("\n")
|
|
@@ -39786,31 +39794,43 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
39786
39794
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
39787
39795
|
};
|
|
39788
39796
|
exports.__esModule = true;
|
|
39789
|
-
exports.
|
|
39790
|
-
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) {
|
|
39791
39802
|
var _a;
|
|
39792
39803
|
if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
|
|
39793
|
-
return
|
|
39804
|
+
return YARN_INSTALL_CLASSIC;
|
|
39794
39805
|
}
|
|
39795
|
-
|
|
39796
|
-
// yarn >= 4 ships with build in plugins, see https://github.com/yarnpkg/berry/pull/4253
|
|
39797
|
-
// trying to import those fail on this version
|
|
39798
|
-
var doesNotShipWithBuiltInPlugins = ["2", "3"].some(function (v) {
|
|
39799
|
-
var _a;
|
|
39800
|
-
return (_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.version.startsWith(v);
|
|
39801
|
-
});
|
|
39802
|
-
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
|
|
39803
|
-
: "".concat((options === null || options === void 0 ? void 0 : options.noScripts) ? "YARN_ENABLE_SCRIPTS=false " : "", "yarn install --immutable");
|
|
39806
|
+
return "yarn install --immutable";
|
|
39804
39807
|
};
|
|
39805
|
-
exports.getYarnInstallCommand = getYarnInstallCommand;
|
|
39806
39808
|
var ensureNodeVersion = function (context) {
|
|
39807
39809
|
return ["if [ -f ./.nvmrc ]; then source /root/.nvm/nvm.sh && nvm install <<< .nvmrc; fi"];
|
|
39808
39810
|
};
|
|
39809
39811
|
exports.ensureNodeVersion = ensureNodeVersion;
|
|
39810
39812
|
var getYarnInstall = function (context) {
|
|
39811
|
-
return __spreadArray(__spreadArray([], __read((0, exports.ensureNodeVersion)(context)), false), [
|
|
39813
|
+
return __spreadArray(__spreadArray([], __read((0, exports.ensureNodeVersion)(context)), false), [getYarnInstallCommand(context)], false);
|
|
39812
39814
|
};
|
|
39813
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;
|
|
39814
39834
|
|
|
39815
39835
|
/***/ }),
|
|
39816
39836
|
|
|
@@ -40211,7 +40231,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
40211
40231
|
|
|
40212
40232
|
exports.__esModule = true;
|
|
40213
40233
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
40214
|
-
exports.PIPELINE_IMAGE_TAG = "main-
|
|
40234
|
+
exports.PIPELINE_IMAGE_TAG = "main-03e0177e" || 0;
|
|
40215
40235
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
40216
40236
|
|
|
40217
40237
|
/***/ }),
|
|
@@ -44228,7 +44248,7 @@ var path_equal_1 = __nccwpck_require__(4843);
|
|
|
44228
44248
|
var yarnUtils_1 = __nccwpck_require__(1369);
|
|
44229
44249
|
var getPackageManagerInfo = function (config, componentName) {
|
|
44230
44250
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
44231
|
-
var version, isClassic, component, workspaces, currentWorkspace, componentIsInWorkspace, workspaceRoot, packageJson, workspacePackageJson, lockFile, configFiles,
|
|
44251
|
+
var version, isClassic, component, workspaces, currentWorkspace, componentIsInWorkspace, workspaceRoot, packageJson, workspacePackageJson, lockFile, configFiles, configFilePaths, workspaceDependencies, pathsToCopyInDocker;
|
|
44232
44252
|
return __generator(this, function (_a) {
|
|
44233
44253
|
switch (_a.label) {
|
|
44234
44254
|
case 0:
|
|
@@ -44250,9 +44270,9 @@ var getPackageManagerInfo = function (config, componentName) {
|
|
|
44250
44270
|
workspacePackageJson = componentIsInWorkspace ? (0, path_1.join)(workspaceRoot, "package.json") : null;
|
|
44251
44271
|
lockFile = componentIsInWorkspace ? (0, path_1.join)(workspaceRoot, "yarn.lock") : (0, path_1.join)(component.dir, "yarn.lock");
|
|
44252
44272
|
configFiles = [".yarnrc", ".yarnrc.yml", ".npmrc", ".yarn"];
|
|
44253
|
-
|
|
44273
|
+
configFilePaths = __spreadArray(__spreadArray([], __read(configFiles), false), __read(configFiles.map(function (f) {
|
|
44254
44274
|
return (0, path_1.join)(component.dir, f);
|
|
44255
|
-
})).filter(function (f) {
|
|
44275
|
+
})), false).filter(function (f) {
|
|
44256
44276
|
return (0, fs_1.existsSync)(f);
|
|
44257
44277
|
});
|
|
44258
44278
|
workspaceDependencies = currentWorkspace ? __spreadArray(__spreadArray([], __read(currentWorkspace.workspaceDependencies), false), __read(currentWorkspace.mismatchedWorkspaceDependencies), false).map(function (name) {
|
|
@@ -44261,7 +44281,7 @@ var getPackageManagerInfo = function (config, componentName) {
|
|
|
44261
44281
|
return w.name === name;
|
|
44262
44282
|
})) === null || _a === void 0 ? void 0 : _a.location;
|
|
44263
44283
|
}).filter(Boolean) : [];
|
|
44264
|
-
pathsToCopyInDocker = __spreadArray(__spreadArray(__spreadArray(__spreadArray([packageJson], __read(workspacePackageJson ? [workspacePackageJson] : []), false), [lockFile], false), __read(
|
|
44284
|
+
pathsToCopyInDocker = __spreadArray(__spreadArray(__spreadArray(__spreadArray([packageJson], __read(workspacePackageJson ? [workspacePackageJson] : []), false), [lockFile], false), __read(configFilePaths), false), __read(workspaceDependencies), false);
|
|
44265
44285
|
return [2 /*return*/, {
|
|
44266
44286
|
type: "yarn",
|
|
44267
44287
|
workspaces: workspaces,
|
|
@@ -350312,6 +350312,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
350312
350312
|
};
|
|
350313
350313
|
exports.__esModule = true;
|
|
350314
350314
|
exports.createCustomTestJobs = void 0;
|
|
350315
|
+
var path_1 = __nccwpck_require__(71017);
|
|
350315
350316
|
var utils_1 = __nccwpck_require__(37461);
|
|
350316
350317
|
var types_1 = __nccwpck_require__(71197);
|
|
350317
350318
|
var RUNNER_CUSTOM_TEST_VARIABLES = {
|
|
@@ -350321,7 +350322,7 @@ var RUNNER_CUSTOM_TEST_VARIABLES = {
|
|
|
350321
350322
|
KUBERNETES_MEMORY_LIMIT: "4Gi"
|
|
350322
350323
|
};
|
|
350323
350324
|
var createCustomTestJobs = function (context) {
|
|
350324
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
350325
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
350325
350326
|
// don't run tests after release
|
|
350326
350327
|
if (((_a = context.commitInfo) === null || _a === void 0 ? void 0 : _a.trigger) === "taggedRelease") {
|
|
350327
350328
|
return [];
|
|
@@ -350340,29 +350341,42 @@ var createCustomTestJobs = function (context) {
|
|
|
350340
350341
|
needs: [],
|
|
350341
350342
|
envMode: "none"
|
|
350342
350343
|
};
|
|
350343
|
-
var auditJob = buildConfig.audit ? __assign(__assign({
|
|
350344
|
+
var auditJob = buildConfig.audit ? __assign(__assign(__assign({
|
|
350344
350345
|
name: "๐ก audit"
|
|
350345
350346
|
}, base), {
|
|
350346
350347
|
image: (_d = (_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.jobImage) !== null && _d !== void 0 ? _d : buildConfig.jobImage,
|
|
350347
350348
|
cache: undefined,
|
|
350348
350349
|
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),
|
|
350349
350350
|
allow_failure: true
|
|
350350
|
-
}) : null;
|
|
350351
|
-
var lintJob = buildConfig.lint ? __assign(__assign({
|
|
350351
|
+
}), createArtifactsConfig(context.componentConfig.dir, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifactsReports)) : null;
|
|
350352
|
+
var lintJob = buildConfig.lint ? __assign(__assign(__assign({
|
|
350352
350353
|
name: "๐ฎ lint"
|
|
350353
350354
|
}, base), {
|
|
350354
|
-
image: (
|
|
350355
|
-
script: __spreadArray([], __read((
|
|
350356
|
-
}) : null;
|
|
350357
|
-
var testJob = buildConfig.test ? __assign(__assign({
|
|
350355
|
+
image: (_j = (_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.jobImage) !== null && _j !== void 0 ? _j : buildConfig.jobImage,
|
|
350356
|
+
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)
|
|
350357
|
+
}), createArtifactsConfig(context.componentConfig.dir, (_m = buildConfig.lint) === null || _m === void 0 ? void 0 : _m.artifactsReports)) : null;
|
|
350358
|
+
var testJob = buildConfig.test ? __assign(__assign(__assign({
|
|
350358
350359
|
name: "๐งช test"
|
|
350359
350360
|
}, base), {
|
|
350360
|
-
image: (
|
|
350361
|
-
script: __spreadArray([], __read((
|
|
350362
|
-
}) : null;
|
|
350361
|
+
image: (_p = (_o = buildConfig.test) === null || _o === void 0 ? void 0 : _o.jobImage) !== null && _p !== void 0 ? _p : buildConfig.jobImage,
|
|
350362
|
+
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)
|
|
350363
|
+
}), createArtifactsConfig(context.componentConfig.dir, (_s = buildConfig.test) === null || _s === void 0 ? void 0 : _s.artifactsReports)) : null;
|
|
350363
350364
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
350364
350365
|
};
|
|
350365
350366
|
exports.createCustomTestJobs = createCustomTestJobs;
|
|
350367
|
+
var createArtifactsConfig = function (rootPath, artifactsReports) {
|
|
350368
|
+
var _a, _b;
|
|
350369
|
+
return artifactsReports ? {
|
|
350370
|
+
artifacts: {
|
|
350371
|
+
paths: [],
|
|
350372
|
+
reports: {
|
|
350373
|
+
junit: (_b = (_a = artifactsReports === null || artifactsReports === void 0 ? void 0 : artifactsReports.junit) === null || _a === void 0 ? void 0 : _a.map(function (p) {
|
|
350374
|
+
return (0, path_1.join)(rootPath, p);
|
|
350375
|
+
})) !== null && _b !== void 0 ? _b : []
|
|
350376
|
+
}
|
|
350377
|
+
}
|
|
350378
|
+
} : undefined;
|
|
350379
|
+
};
|
|
350366
350380
|
|
|
350367
350381
|
/***/ }),
|
|
350368
350382
|
|
|
@@ -350680,13 +350694,7 @@ var createNodeBuildJobs = function (context) {
|
|
|
350680
350694
|
cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context, "pull")), false),
|
|
350681
350695
|
variables: {
|
|
350682
350696
|
// only required for non static
|
|
350683
|
-
|
|
350684
|
-
prodOnly: true
|
|
350685
|
-
}),
|
|
350686
|
-
YARN_INSTALL_WITHOUT_SCRIPTS: (0, yarn_1.getYarnInstallCommand)(context, {
|
|
350687
|
-
prodOnly: true,
|
|
350688
|
-
noScripts: true
|
|
350689
|
-
}),
|
|
350697
|
+
DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context),
|
|
350690
350698
|
DOCKER_COPY_WORKSPACE_FILES: (_e = (_d = context.packageManagerInfo) === null || _d === void 0 ? void 0 : _d.pathsToCopyInDocker.map(function (dir) {
|
|
350691
350699
|
return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir);
|
|
350692
350700
|
})) === null || _e === void 0 ? void 0 : _e.join("\n")
|
|
@@ -351089,31 +351097,43 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
351089
351097
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
351090
351098
|
};
|
|
351091
351099
|
exports.__esModule = true;
|
|
351092
|
-
exports.
|
|
351093
|
-
var
|
|
351100
|
+
exports.getDockerAppCopyAndBuildScript = exports.getYarnInstall = exports.ensureNodeVersion = void 0;
|
|
351101
|
+
var YARN_INSTALL_CLASSIC = "yarn install --frozen-lockfile";
|
|
351102
|
+
// FIXME: check why and when rebuild is needed
|
|
351103
|
+
var YARN_BERRY_PROD_REBUILD = "yarn workspaces focus --production && yarn rebuild";
|
|
351104
|
+
var getYarnInstallCommand = function (context) {
|
|
351094
351105
|
var _a;
|
|
351095
351106
|
if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
|
|
351096
|
-
return
|
|
351107
|
+
return YARN_INSTALL_CLASSIC;
|
|
351097
351108
|
}
|
|
351098
|
-
|
|
351099
|
-
// yarn >= 4 ships with build in plugins, see https://github.com/yarnpkg/berry/pull/4253
|
|
351100
|
-
// trying to import those fail on this version
|
|
351101
|
-
var doesNotShipWithBuiltInPlugins = ["2", "3"].some(function (v) {
|
|
351102
|
-
var _a;
|
|
351103
|
-
return (_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.version.startsWith(v);
|
|
351104
|
-
});
|
|
351105
|
-
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
|
|
351106
|
-
: "".concat((options === null || options === void 0 ? void 0 : options.noScripts) ? "YARN_ENABLE_SCRIPTS=false " : "", "yarn install --immutable");
|
|
351109
|
+
return "yarn install --immutable";
|
|
351107
351110
|
};
|
|
351108
|
-
exports.getYarnInstallCommand = getYarnInstallCommand;
|
|
351109
351111
|
var ensureNodeVersion = function (context) {
|
|
351110
351112
|
return ["if [ -f ./.nvmrc ]; then source /root/.nvm/nvm.sh && nvm install <<< .nvmrc; fi"];
|
|
351111
351113
|
};
|
|
351112
351114
|
exports.ensureNodeVersion = ensureNodeVersion;
|
|
351113
351115
|
var getYarnInstall = function (context) {
|
|
351114
|
-
return __spreadArray(__spreadArray([], __read((0, exports.ensureNodeVersion)(context)), false), [
|
|
351116
|
+
return __spreadArray(__spreadArray([], __read((0, exports.ensureNodeVersion)(context)), false), [getYarnInstallCommand(context)], false);
|
|
351115
351117
|
};
|
|
351116
351118
|
exports.getYarnInstall = getYarnInstall;
|
|
351119
|
+
var DOCKER_COPY_FILES = "COPY --chown=node:node $APP_DIR .";
|
|
351120
|
+
var getDockerAppCopyAndBuildScript = function (context) {
|
|
351121
|
+
var _a;
|
|
351122
|
+
if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
|
|
351123
|
+
return "\nRUN ".concat(YARN_INSTALL_CLASSIC, " --production --ignore-scripts\n").concat(DOCKER_COPY_FILES, "\nRUN ").concat(YARN_INSTALL_CLASSIC, " --production \n ").trim();
|
|
351124
|
+
}
|
|
351125
|
+
// yarn >= 4 ships with build in plugins, see https://github.com/yarnpkg/berry/pull/4253
|
|
351126
|
+
// trying to import those fail on this version
|
|
351127
|
+
var doesNotShipWithBuiltInPlugins = ["2", "3"].some(function (v) {
|
|
351128
|
+
var _a;
|
|
351129
|
+
return (_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.version.startsWith(v);
|
|
351130
|
+
});
|
|
351131
|
+
var maybeAddWorkspaceToolsCommand = doesNotShipWithBuiltInPlugins ? "RUN yarn plugin import workspace-tools" : "";
|
|
351132
|
+
// copy first everything and then install
|
|
351133
|
+
// rebuild first does not work as it will run postinstall and that might require files in the app
|
|
351134
|
+
return "\n".concat(DOCKER_COPY_FILES, "\n").concat(maybeAddWorkspaceToolsCommand, "\nRUN ").concat(YARN_BERRY_PROD_REBUILD, "\n\n ").trim();
|
|
351135
|
+
};
|
|
351136
|
+
exports.getDockerAppCopyAndBuildScript = getDockerAppCopyAndBuildScript;
|
|
351117
351137
|
|
|
351118
351138
|
/***/ }),
|
|
351119
351139
|
|
|
@@ -351514,7 +351534,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
351514
351534
|
|
|
351515
351535
|
exports.__esModule = true;
|
|
351516
351536
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
351517
|
-
exports.PIPELINE_IMAGE_TAG = "main-
|
|
351537
|
+
exports.PIPELINE_IMAGE_TAG = "main-03e0177e" || 0;
|
|
351518
351538
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
351519
351539
|
|
|
351520
351540
|
/***/ }),
|
|
@@ -355531,7 +355551,7 @@ var path_equal_1 = __nccwpck_require__(84843);
|
|
|
355531
355551
|
var yarnUtils_1 = __nccwpck_require__(51369);
|
|
355532
355552
|
var getPackageManagerInfo = function (config, componentName) {
|
|
355533
355553
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
355534
|
-
var version, isClassic, component, workspaces, currentWorkspace, componentIsInWorkspace, workspaceRoot, packageJson, workspacePackageJson, lockFile, configFiles,
|
|
355554
|
+
var version, isClassic, component, workspaces, currentWorkspace, componentIsInWorkspace, workspaceRoot, packageJson, workspacePackageJson, lockFile, configFiles, configFilePaths, workspaceDependencies, pathsToCopyInDocker;
|
|
355535
355555
|
return __generator(this, function (_a) {
|
|
355536
355556
|
switch (_a.label) {
|
|
355537
355557
|
case 0:
|
|
@@ -355553,9 +355573,9 @@ var getPackageManagerInfo = function (config, componentName) {
|
|
|
355553
355573
|
workspacePackageJson = componentIsInWorkspace ? (0, path_1.join)(workspaceRoot, "package.json") : null;
|
|
355554
355574
|
lockFile = componentIsInWorkspace ? (0, path_1.join)(workspaceRoot, "yarn.lock") : (0, path_1.join)(component.dir, "yarn.lock");
|
|
355555
355575
|
configFiles = [".yarnrc", ".yarnrc.yml", ".npmrc", ".yarn"];
|
|
355556
|
-
|
|
355576
|
+
configFilePaths = __spreadArray(__spreadArray([], __read(configFiles), false), __read(configFiles.map(function (f) {
|
|
355557
355577
|
return (0, path_1.join)(component.dir, f);
|
|
355558
|
-
})).filter(function (f) {
|
|
355578
|
+
})), false).filter(function (f) {
|
|
355559
355579
|
return (0, fs_1.existsSync)(f);
|
|
355560
355580
|
});
|
|
355561
355581
|
workspaceDependencies = currentWorkspace ? __spreadArray(__spreadArray([], __read(currentWorkspace.workspaceDependencies), false), __read(currentWorkspace.mismatchedWorkspaceDependencies), false).map(function (name) {
|
|
@@ -355564,7 +355584,7 @@ var getPackageManagerInfo = function (config, componentName) {
|
|
|
355564
355584
|
return w.name === name;
|
|
355565
355585
|
})) === null || _a === void 0 ? void 0 : _a.location;
|
|
355566
355586
|
}).filter(Boolean) : [];
|
|
355567
|
-
pathsToCopyInDocker = __spreadArray(__spreadArray(__spreadArray(__spreadArray([packageJson], __read(workspacePackageJson ? [workspacePackageJson] : []), false), [lockFile], false), __read(
|
|
355587
|
+
pathsToCopyInDocker = __spreadArray(__spreadArray(__spreadArray(__spreadArray([packageJson], __read(workspacePackageJson ? [workspacePackageJson] : []), false), [lockFile], false), __read(configFilePaths), false), __read(workspaceDependencies), false);
|
|
355568
355588
|
return [2 /*return*/, {
|
|
355569
355589
|
type: "yarn",
|
|
355570
355590
|
workspaces: workspaces,
|