arui-scripts 13.3.0 → 13.3.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [13.3.1](https://git.moscow.alfaintra.net/ef/arui-scripts/compare/v13.3.0...v13.3.1) (2022-12-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **docker-build-compiled:** add yarn2 required files before build ([c252535](https://git.moscow.alfaintra.net/ef/arui-scripts/commit/c2525358e7573e599bbdb20160453cc077f5a083))
7
+ * **docker-build-compiled:** don't override existing .dockerignore ([b0c20c2](https://git.moscow.alfaintra.net/ef/arui-scripts/commit/b0c20c25792edbb5b73cd2bb36725b214cb4aadd))
8
+
1
9
  # [13.3.0](https://git.moscow.alfaintra.net/ef/arui-scripts/compare/v13.2.1...v13.3.0) (2022-12-08)
2
10
 
3
11
 
@@ -31,7 +31,7 @@ const docker_build_1 = require("../util/docker-build");
31
31
  startScript: start_template_1.default,
32
32
  allowLocalDockerfile: false,
33
33
  });
34
- yield exec_1.default('echo "node_modules" > .dockerignore');
34
+ yield exec_1.default('echo "node_modules" >> .dockerignore');
35
35
  yield exec_1.default(`docker build -f "./${tempDirName}/Dockerfile" \\
36
36
  --build-arg START_SH_LOCATION="./${tempDirName}/start.sh" \\
37
37
  --build-arg NGINX_CONF_LOCATION="./${tempDirName}/nginx.conf" -t ${imageFullName} .`);
@@ -1,4 +1,5 @@
1
- declare type Yarn = '1' | '2+' | 'unavailable';
2
- export declare function getYarnVersion(): Yarn;
1
+ declare type YarnVersion = '1' | '2+' | 'unavailable';
2
+ export declare function getYarnVersion(): YarnVersion;
3
3
  export declare function getPruningCommand(): string;
4
+ export declare function getInstallProductionCommand(): string;
4
5
  export {};
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getPruningCommand = exports.getYarnVersion = void 0;
6
+ exports.getInstallProductionCommand = exports.getPruningCommand = exports.getYarnVersion = void 0;
7
7
  const app_configs_1 = __importDefault(require("../../configs/app-configs"));
8
8
  const shelljs_1 = __importDefault(require("shelljs"));
9
9
  function getYarnVersion() {
@@ -33,3 +33,21 @@ function getPruningCommand() {
33
33
  }
34
34
  }
35
35
  exports.getPruningCommand = getPruningCommand;
36
+ function getInstallProductionCommand() {
37
+ const yarnVersion = getYarnVersion();
38
+ switch (yarnVersion) {
39
+ case '1': {
40
+ return 'yarn install --production --ignore-optional --frozen-lockfile --ignore-scripts --prefer-offline';
41
+ }
42
+ case '2+': {
43
+ return 'yarn workspaces focus --production --all';
44
+ }
45
+ case 'unavailable': {
46
+ return 'npm install --production';
47
+ }
48
+ default: {
49
+ return '';
50
+ }
51
+ }
52
+ }
53
+ exports.getInstallProductionCommand = getInstallProductionCommand;
@@ -6,7 +6,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const app_configs_1 = __importDefault(require("../configs/app-configs"));
7
7
  const apply_overrides_1 = __importDefault(require("../configs/util/apply-overrides"));
8
8
  const yarn_1 = require("../commands/util/yarn");
9
- const pruneCommand = yarn_1.getPruningCommand();
9
+ const installProductionCommand = yarn_1.getInstallProductionCommand();
10
+ const yarnVersion = yarn_1.getYarnVersion();
11
+ // В зависимости от используемого мендежера зависимостей для их установки нужно копировать разный набор файлов
12
+ const filesRequiredToInstallDependencies = [
13
+ 'package.json',
14
+ 'yarn.lock',
15
+ yarnVersion === '2+' && '.yarnrc.yml',
16
+ yarnVersion === '2+' && '.yarn',
17
+ yarnVersion === 'unavailable' && 'package-lock.json',
18
+ ].filter(Boolean);
10
19
  const dockerfileTemplate = `
11
20
  FROM ${app_configs_1.default.baseDockerImage}
12
21
  ARG START_SH_LOCATION
@@ -19,10 +28,10 @@ ADD $START_SH_LOCATION /src/start.sh
19
28
  ADD $NGINX_CONF_LOCATION /src/nginx.conf
20
29
 
21
30
  # Зависимости. При некоторой удаче могут кешироваться и соответственно кешировать установку зависимостей
22
- ADD --chown=nginx:nginx yarn.lock /src/yarn.lock
23
- ADD --chown=nginx:nginx package.json /src/package.json
24
- RUN ${pruneCommand} && \\
25
- yarn cache clean
31
+ ${filesRequiredToInstallDependencies.map((file) => `ADD --chown=nginx:nginx ${file} /src/${file}`).join('\n')}
32
+
33
+ RUN ${installProductionCommand} && \\
34
+ ${yarnVersion === 'unavailable' ? 'npm cache clean --force' : 'yarn cache clean'}
26
35
 
27
36
  ADD --chown=nginx:nginx . /src
28
37
 
@@ -812,8 +812,8 @@
812
812
  "affectsGlobalScope": false
813
813
  },
814
814
  "../src/commands/util/yarn.ts": {
815
- "version": "dd12d363b52256367a5544cef5c9680bd61e2009c20c27b43030cda98e5442bc",
816
- "signature": "5e4804f7f7c63d44608026235d1745631daf6b0a5b5be541290ef33b0d11506d",
815
+ "version": "a1bcdf2aa30695708c6515646afc4af07a7a82a5412b2767d0d99b03492770aa",
816
+ "signature": "bbedd649d02ef49ddad1a830281d0e9506b22849394c2617783f4d30ee6c310f",
817
817
  "affectsGlobalScope": false
818
818
  },
819
819
  "../src/commands/archive-build/index.ts": {
@@ -1342,12 +1342,12 @@
1342
1342
  "affectsGlobalScope": false
1343
1343
  },
1344
1344
  "../src/templates/dockerfile-compiled.template.ts": {
1345
- "version": "46a07d2e09f3188183ace3b4a4c1ec4e3d2158bcc34428203427cbd4af58a21a",
1345
+ "version": "6b17e128c546b5122aeb3b6b0fd54cb3d2ccd55e336bfa9ffd5ab8525fa26835",
1346
1346
  "signature": "0fffbf1a5f54522ff7b89592bab1cf72966d7bdc613d52b0087717fcfec14b29",
1347
1347
  "affectsGlobalScope": false
1348
1348
  },
1349
1349
  "../src/commands/docker-build-compiled/index.ts": {
1350
- "version": "049601949b38615d0b35001e2c12d7fcd50a0b1df1670e3d271b6bc83b76d82a",
1350
+ "version": "795b8a44ac56b87989f2dd38e635432d434235c7ee92531db9e53399f1ac7df2",
1351
1351
  "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
1352
1352
  "affectsGlobalScope": false
1353
1353
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arui-scripts",
3
- "version": "13.3.0",
3
+ "version": "13.3.1",
4
4
  "main": "./build/index.js",
5
5
  "typings": "./build/index.d.ts",
6
6
  "license": "MPL-2.0",