@catladder/cli 0.0.0-main-bc2a3387 → 0.0.0-main-205341d4

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.
@@ -39377,13 +39377,7 @@ var createNodeBuildJobs = function (context) {
39377
39377
  cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context, "pull")), false),
39378
39378
  variables: {
39379
39379
  // only required for non static
39380
- YARN_INSTALL: (0, yarn_1.getYarnInstallCommand)(context, {
39381
- prodOnly: true
39382
- }),
39383
- YARN_INSTALL_WITHOUT_SCRIPTS: (0, yarn_1.getYarnInstallCommand)(context, {
39384
- prodOnly: true,
39385
- noScripts: true
39386
- }),
39380
+ DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context),
39387
39381
  DOCKER_COPY_WORKSPACE_FILES: (_e = (_d = context.packageManagerInfo) === null || _d === void 0 ? void 0 : _d.pathsToCopyInDocker.map(function (dir) {
39388
39382
  return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir);
39389
39383
  })) === null || _e === void 0 ? void 0 : _e.join("\n")
@@ -39786,31 +39780,43 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
39786
39780
  return to.concat(ar || Array.prototype.slice.call(from));
39787
39781
  };
39788
39782
  exports.__esModule = true;
39789
- exports.getYarnInstall = exports.ensureNodeVersion = exports.getYarnInstallCommand = void 0;
39790
- var getYarnInstallCommand = function (context, options) {
39783
+ exports.getDockerAppCopyAndBuildScript = exports.getYarnInstall = exports.ensureNodeVersion = void 0;
39784
+ var YARN_INSTALL_CLASSIC = "yarn install --frozen-lockfile";
39785
+ // FIXME: check why and when rebuild is needed
39786
+ var YARN_BERRY_PROD_REBUILD = "yarn workspaces focus --production && yarn rebuild";
39787
+ var getYarnInstallCommand = function (context) {
39791
39788
  var _a;
39792
39789
  if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
39793
- return "yarn install --frozen-lockfile ".concat((options === null || options === void 0 ? void 0 : options.prodOnly) ? "--production" : "", " ").concat((options === null || options === void 0 ? void 0 : options.noScripts) ? "--ignore-scripts" : "");
39790
+ return YARN_INSTALL_CLASSIC;
39794
39791
  }
39795
- // is modern
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");
39792
+ return "yarn install --immutable";
39804
39793
  };
39805
- exports.getYarnInstallCommand = getYarnInstallCommand;
39806
39794
  var ensureNodeVersion = function (context) {
39807
39795
  return ["if [ -f ./.nvmrc ]; then source /root/.nvm/nvm.sh && nvm install <<< .nvmrc; fi"];
39808
39796
  };
39809
39797
  exports.ensureNodeVersion = ensureNodeVersion;
39810
39798
  var getYarnInstall = function (context) {
39811
- return __spreadArray(__spreadArray([], __read((0, exports.ensureNodeVersion)(context)), false), [(0, exports.getYarnInstallCommand)(context)], false);
39799
+ return __spreadArray(__spreadArray([], __read((0, exports.ensureNodeVersion)(context)), false), [getYarnInstallCommand(context)], false);
39812
39800
  };
39813
39801
  exports.getYarnInstall = getYarnInstall;
39802
+ var DOCKER_COPY_FILES = "COPY --chown=node:node $APP_DIR .";
39803
+ var getDockerAppCopyAndBuildScript = function (context) {
39804
+ var _a;
39805
+ if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
39806
+ return "\nRUN ".concat(YARN_INSTALL_CLASSIC, " --production --ignore-scripts\n").concat(DOCKER_COPY_FILES, "\nRUN ").concat(YARN_INSTALL_CLASSIC, " --production \n ").trim();
39807
+ }
39808
+ // yarn >= 4 ships with build in plugins, see https://github.com/yarnpkg/berry/pull/4253
39809
+ // trying to import those fail on this version
39810
+ var doesNotShipWithBuiltInPlugins = ["2", "3"].some(function (v) {
39811
+ var _a;
39812
+ return (_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.version.startsWith(v);
39813
+ });
39814
+ var maybeAddWorkspaceToolsCommand = doesNotShipWithBuiltInPlugins ? "RUN yarn plugin import workspace-tools" : "";
39815
+ // copy first everything and then install
39816
+ // rebuild first does not work as it will run postinstall and that might require files in the app
39817
+ return "\n".concat(DOCKER_COPY_FILES, "\n").concat(maybeAddWorkspaceToolsCommand, "\nRUN ").concat(YARN_BERRY_PROD_REBUILD, "\n\n ").trim();
39818
+ };
39819
+ exports.getDockerAppCopyAndBuildScript = getDockerAppCopyAndBuildScript;
39814
39820
 
39815
39821
  /***/ }),
39816
39822
 
@@ -40211,7 +40217,7 @@ exports.readConfigSync = readConfigSync;
40211
40217
 
40212
40218
  exports.__esModule = true;
40213
40219
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
40214
- exports.PIPELINE_IMAGE_TAG = "main-bc2a3387" || 0;
40220
+ exports.PIPELINE_IMAGE_TAG = "main-205341d4" || 0;
40215
40221
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
40216
40222
 
40217
40223
  /***/ }),
@@ -44228,7 +44234,7 @@ var path_equal_1 = __nccwpck_require__(4843);
44228
44234
  var yarnUtils_1 = __nccwpck_require__(1369);
44229
44235
  var getPackageManagerInfo = function (config, componentName) {
44230
44236
  return __awaiter(void 0, void 0, void 0, function () {
44231
- var version, isClassic, component, workspaces, currentWorkspace, componentIsInWorkspace, workspaceRoot, packageJson, workspacePackageJson, lockFile, configFiles, rcFiles, workspaceDependencies, pathsToCopyInDocker;
44237
+ var version, isClassic, component, workspaces, currentWorkspace, componentIsInWorkspace, workspaceRoot, packageJson, workspacePackageJson, lockFile, configFiles, configFilePaths, workspaceDependencies, pathsToCopyInDocker;
44232
44238
  return __generator(this, function (_a) {
44233
44239
  switch (_a.label) {
44234
44240
  case 0:
@@ -44250,9 +44256,9 @@ var getPackageManagerInfo = function (config, componentName) {
44250
44256
  workspacePackageJson = componentIsInWorkspace ? (0, path_1.join)(workspaceRoot, "package.json") : null;
44251
44257
  lockFile = componentIsInWorkspace ? (0, path_1.join)(workspaceRoot, "yarn.lock") : (0, path_1.join)(component.dir, "yarn.lock");
44252
44258
  configFiles = [".yarnrc", ".yarnrc.yml", ".npmrc", ".yarn"];
44253
- rcFiles = (componentIsInWorkspace ? configFiles : configFiles.map(function (f) {
44259
+ configFilePaths = __spreadArray(__spreadArray([], __read(configFiles), false), __read(configFiles.map(function (f) {
44254
44260
  return (0, path_1.join)(component.dir, f);
44255
- })).filter(function (f) {
44261
+ })), false).filter(function (f) {
44256
44262
  return (0, fs_1.existsSync)(f);
44257
44263
  });
44258
44264
  workspaceDependencies = currentWorkspace ? __spreadArray(__spreadArray([], __read(currentWorkspace.workspaceDependencies), false), __read(currentWorkspace.mismatchedWorkspaceDependencies), false).map(function (name) {
@@ -44261,7 +44267,7 @@ var getPackageManagerInfo = function (config, componentName) {
44261
44267
  return w.name === name;
44262
44268
  })) === null || _a === void 0 ? void 0 : _a.location;
44263
44269
  }).filter(Boolean) : [];
44264
- pathsToCopyInDocker = __spreadArray(__spreadArray(__spreadArray(__spreadArray([packageJson], __read(workspacePackageJson ? [workspacePackageJson] : []), false), [lockFile], false), __read(rcFiles), false), __read(workspaceDependencies), false);
44270
+ pathsToCopyInDocker = __spreadArray(__spreadArray(__spreadArray(__spreadArray([packageJson], __read(workspacePackageJson ? [workspacePackageJson] : []), false), [lockFile], false), __read(configFilePaths), false), __read(workspaceDependencies), false);
44265
44271
  return [2 /*return*/, {
44266
44272
  type: "yarn",
44267
44273
  workspaces: workspaces,
@@ -350680,13 +350680,7 @@ var createNodeBuildJobs = function (context) {
350680
350680
  cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context, "pull")), false),
350681
350681
  variables: {
350682
350682
  // only required for non static
350683
- YARN_INSTALL: (0, yarn_1.getYarnInstallCommand)(context, {
350684
- prodOnly: true
350685
- }),
350686
- YARN_INSTALL_WITHOUT_SCRIPTS: (0, yarn_1.getYarnInstallCommand)(context, {
350687
- prodOnly: true,
350688
- noScripts: true
350689
- }),
350683
+ DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context),
350690
350684
  DOCKER_COPY_WORKSPACE_FILES: (_e = (_d = context.packageManagerInfo) === null || _d === void 0 ? void 0 : _d.pathsToCopyInDocker.map(function (dir) {
350691
350685
  return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir);
350692
350686
  })) === null || _e === void 0 ? void 0 : _e.join("\n")
@@ -351089,31 +351083,43 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
351089
351083
  return to.concat(ar || Array.prototype.slice.call(from));
351090
351084
  };
351091
351085
  exports.__esModule = true;
351092
- exports.getYarnInstall = exports.ensureNodeVersion = exports.getYarnInstallCommand = void 0;
351093
- var getYarnInstallCommand = function (context, options) {
351086
+ exports.getDockerAppCopyAndBuildScript = exports.getYarnInstall = exports.ensureNodeVersion = void 0;
351087
+ var YARN_INSTALL_CLASSIC = "yarn install --frozen-lockfile";
351088
+ // FIXME: check why and when rebuild is needed
351089
+ var YARN_BERRY_PROD_REBUILD = "yarn workspaces focus --production && yarn rebuild";
351090
+ var getYarnInstallCommand = function (context) {
351094
351091
  var _a;
351095
351092
  if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
351096
- return "yarn install --frozen-lockfile ".concat((options === null || options === void 0 ? void 0 : options.prodOnly) ? "--production" : "", " ").concat((options === null || options === void 0 ? void 0 : options.noScripts) ? "--ignore-scripts" : "");
351093
+ return YARN_INSTALL_CLASSIC;
351097
351094
  }
351098
- // is modern
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");
351095
+ return "yarn install --immutable";
351107
351096
  };
351108
- exports.getYarnInstallCommand = getYarnInstallCommand;
351109
351097
  var ensureNodeVersion = function (context) {
351110
351098
  return ["if [ -f ./.nvmrc ]; then source /root/.nvm/nvm.sh && nvm install <<< .nvmrc; fi"];
351111
351099
  };
351112
351100
  exports.ensureNodeVersion = ensureNodeVersion;
351113
351101
  var getYarnInstall = function (context) {
351114
- return __spreadArray(__spreadArray([], __read((0, exports.ensureNodeVersion)(context)), false), [(0, exports.getYarnInstallCommand)(context)], false);
351102
+ return __spreadArray(__spreadArray([], __read((0, exports.ensureNodeVersion)(context)), false), [getYarnInstallCommand(context)], false);
351115
351103
  };
351116
351104
  exports.getYarnInstall = getYarnInstall;
351105
+ var DOCKER_COPY_FILES = "COPY --chown=node:node $APP_DIR .";
351106
+ var getDockerAppCopyAndBuildScript = function (context) {
351107
+ var _a;
351108
+ if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
351109
+ return "\nRUN ".concat(YARN_INSTALL_CLASSIC, " --production --ignore-scripts\n").concat(DOCKER_COPY_FILES, "\nRUN ").concat(YARN_INSTALL_CLASSIC, " --production \n ").trim();
351110
+ }
351111
+ // yarn >= 4 ships with build in plugins, see https://github.com/yarnpkg/berry/pull/4253
351112
+ // trying to import those fail on this version
351113
+ var doesNotShipWithBuiltInPlugins = ["2", "3"].some(function (v) {
351114
+ var _a;
351115
+ return (_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.version.startsWith(v);
351116
+ });
351117
+ var maybeAddWorkspaceToolsCommand = doesNotShipWithBuiltInPlugins ? "RUN yarn plugin import workspace-tools" : "";
351118
+ // copy first everything and then install
351119
+ // rebuild first does not work as it will run postinstall and that might require files in the app
351120
+ return "\n".concat(DOCKER_COPY_FILES, "\n").concat(maybeAddWorkspaceToolsCommand, "\nRUN ").concat(YARN_BERRY_PROD_REBUILD, "\n\n ").trim();
351121
+ };
351122
+ exports.getDockerAppCopyAndBuildScript = getDockerAppCopyAndBuildScript;
351117
351123
 
351118
351124
  /***/ }),
351119
351125
 
@@ -351514,7 +351520,7 @@ exports.readConfigSync = readConfigSync;
351514
351520
 
351515
351521
  exports.__esModule = true;
351516
351522
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
351517
- exports.PIPELINE_IMAGE_TAG = "main-bc2a3387" || 0;
351523
+ exports.PIPELINE_IMAGE_TAG = "main-205341d4" || 0;
351518
351524
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
351519
351525
 
351520
351526
  /***/ }),
@@ -355531,7 +355537,7 @@ var path_equal_1 = __nccwpck_require__(84843);
355531
355537
  var yarnUtils_1 = __nccwpck_require__(51369);
355532
355538
  var getPackageManagerInfo = function (config, componentName) {
355533
355539
  return __awaiter(void 0, void 0, void 0, function () {
355534
- var version, isClassic, component, workspaces, currentWorkspace, componentIsInWorkspace, workspaceRoot, packageJson, workspacePackageJson, lockFile, configFiles, rcFiles, workspaceDependencies, pathsToCopyInDocker;
355540
+ var version, isClassic, component, workspaces, currentWorkspace, componentIsInWorkspace, workspaceRoot, packageJson, workspacePackageJson, lockFile, configFiles, configFilePaths, workspaceDependencies, pathsToCopyInDocker;
355535
355541
  return __generator(this, function (_a) {
355536
355542
  switch (_a.label) {
355537
355543
  case 0:
@@ -355553,9 +355559,9 @@ var getPackageManagerInfo = function (config, componentName) {
355553
355559
  workspacePackageJson = componentIsInWorkspace ? (0, path_1.join)(workspaceRoot, "package.json") : null;
355554
355560
  lockFile = componentIsInWorkspace ? (0, path_1.join)(workspaceRoot, "yarn.lock") : (0, path_1.join)(component.dir, "yarn.lock");
355555
355561
  configFiles = [".yarnrc", ".yarnrc.yml", ".npmrc", ".yarn"];
355556
- rcFiles = (componentIsInWorkspace ? configFiles : configFiles.map(function (f) {
355562
+ configFilePaths = __spreadArray(__spreadArray([], __read(configFiles), false), __read(configFiles.map(function (f) {
355557
355563
  return (0, path_1.join)(component.dir, f);
355558
- })).filter(function (f) {
355564
+ })), false).filter(function (f) {
355559
355565
  return (0, fs_1.existsSync)(f);
355560
355566
  });
355561
355567
  workspaceDependencies = currentWorkspace ? __spreadArray(__spreadArray([], __read(currentWorkspace.workspaceDependencies), false), __read(currentWorkspace.mismatchedWorkspaceDependencies), false).map(function (name) {
@@ -355564,7 +355570,7 @@ var getPackageManagerInfo = function (config, componentName) {
355564
355570
  return w.name === name;
355565
355571
  })) === null || _a === void 0 ? void 0 : _a.location;
355566
355572
  }).filter(Boolean) : [];
355567
- pathsToCopyInDocker = __spreadArray(__spreadArray(__spreadArray(__spreadArray([packageJson], __read(workspacePackageJson ? [workspacePackageJson] : []), false), [lockFile], false), __read(rcFiles), false), __read(workspaceDependencies), false);
355573
+ pathsToCopyInDocker = __spreadArray(__spreadArray(__spreadArray(__spreadArray([packageJson], __read(workspacePackageJson ? [workspacePackageJson] : []), false), [lockFile], false), __read(configFilePaths), false), __read(workspaceDependencies), false);
355568
355574
  return [2 /*return*/, {
355569
355575
  type: "yarn",
355570
355576
  workspaces: workspaces,
package/package.json CHANGED
@@ -24,7 +24,7 @@
24
24
  "node": ">=12.0.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@catladder/pipeline": "0.0.0-main-bc2a3387",
27
+ "@catladder/pipeline": "0.0.0-main-205341d4",
28
28
  "@kubernetes/client-node": "^0.16.2",
29
29
  "@tsconfig/node14": "^1.0.1",
30
30
  "@types/common-tags": "^1.8.0",
@@ -57,6 +57,6 @@
57
57
  "typescript": "^4.5.4",
58
58
  "vorpal": "^1.12.0"
59
59
  },
60
- "version": "0.0.0-main-bc2a3387",
60
+ "version": "0.0.0-main-205341d4",
61
61
  "stableVersion": "0.0.0"
62
62
  }