yakuza0 2.22.39 → 2.22.40-beta.0

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/cli/index.js CHANGED
@@ -368,7 +368,7 @@ var run = exports.run = function () {
368
368
  })));
369
369
 
370
370
  _commander2.default.command('image').description('Build image.').option('-nc, --no-cache', 'Do not use cache when building the image').action((0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6() {
371
- var isTestInner, res, inner, CS, isInner, CLNENV, CLNBUILD, CLNPACK, noCache, CLNWORKERS, TRY_TIMES, CLNVERSION, pkg, NMCI, projectName, obj, imageReleaseName, imageReleaseNameSave, BI, loop;
371
+ var isTestInner, res, inner, CS, isInner, CLNENV, CLNBUILD, CLNPACK, noCache, CLNWORKERS, TRY_TIMES, CLNVERSION, pkg, NMCI, projectName, obj, imageReleaseName, imageReleaseNameSave, BI, DEP, EXPORT, Dockerfile, prefixCmd, loop;
372
372
  return _regenerator2.default.wrap(function _callee6$(_context6) {
373
373
  while (1) {
374
374
  switch (_context6.prev = _context6.next) {
@@ -405,12 +405,21 @@ var run = exports.run = function () {
405
405
  NMCI = 'nm_' + (0, _server.md5)((0, _stringify2.default)(obj.dependencies) + (0, _stringify2.default)(obj.peerDependencies) + (0, _stringify2.default)(obj.devDependencies)).substring(0, 6);
406
406
  CLNVERSION = process.env.CLN_IMAGE_VERSION || obj.version;
407
407
  } catch (e) {}
408
+ projectName = process.env.CLN_IMAGE_NAME || projectName;
408
409
  imageReleaseName = projectName + ':' + CLNVERSION;
409
410
  imageReleaseNameSave = projectName + '_' + CLNVERSION;
410
- BI = isInner ? 'fe-repo.inner.px.nfjbill.ren:5000/cln-server:0.6.2' : 'nfjbill/cln-server:0.6.2';
411
+ BI = process.env.CLN_IMAGE_BI || isInner ? 'fe-repo.inner.px.nfjbill.ren:5000/cln-server:0.6.2' : 'nfjbill/cln-server:0.6.2';
412
+ DEP = process.env.CLN_IMAGE_DEP !== "false" ? process.env.CLN_IMAGE_DEP : false;
413
+ EXPORT = process.env.CLN_IMAGE_EXPORT !== "false";
414
+ Dockerfile = "Dockerfile";
415
+
416
+
417
+ if (DEP) {
418
+ Dockerfile = "Dockerfile_DEP";
419
+ }
411
420
 
412
421
  if ((0, _commandExists.sync)('docker')) {
413
- _context6.next = 22;
422
+ _context6.next = 27;
414
423
  break;
415
424
  }
416
425
 
@@ -418,22 +427,28 @@ var run = exports.run = function () {
418
427
  process.exit(1);
419
428
  return _context6.abrupt('return');
420
429
 
421
- case 22:
422
- if (!(0, _commandExists.sync)('pxnpm')) {
430
+ case 27:
431
+ if (!(0, _commandExists.sync)('pxnpm') && !DEP) {
423
432
  execCmd(isInner ? 'npm i -g pxnpm --registry=http://fe-repo.inner.px.nfjbill.ren:5507' : 'npm i -g pxnpm');
424
433
  }
425
- if (!(0, _commandExists.sync)('cross-env')) {
434
+ if (!(0, _commandExists.sync)('cross-env') && !DEP) {
426
435
  execCmd('pxnpm i -g cross-env');
427
436
  }
428
437
 
438
+ prefixCmd = "cross-env ";
439
+
440
+ if (!DEP) {
441
+ prefixCmd = "";
442
+ }
443
+
429
444
  if (CLNBUILD) {
430
- execCmd('cross-env YK0_server__yk4Addr=http://1.1.1.1 YK0_server__orbAddr=http://1.1.1.1 YK_ENV=' + CLNENV + ' YK_SERVER_ENV=' + CLNENV + ' YK_VERSIONSHA=' + CS + ' YK_DOCKERNAME=' + CS + ' YK_MACHINE_TYPE=workstation YK0_env=docker YK0_CONFIG_WORKERS=' + CLNWORKERS + ' pxnpm run build');
445
+ execCmd(prefixCmd + ' YK0_server__yk4Addr=http://1.1.1.1 YK0_server__orbAddr=http://1.1.1.1 YK_ENV=' + CLNENV + ' YK_SERVER_ENV=' + CLNENV + ' YK_VERSIONSHA=' + CS + ' YK_DOCKERNAME=' + CS + ' YK_MACHINE_TYPE=workstation YK0_env=docker YK0_CONFIG_WORKERS=' + CLNWORKERS + ' pxnpm run build');
431
446
  }
432
447
 
433
448
  loop = function loop(i) {
434
449
  try {
435
450
  if (i < parseInt(TRY_TIMES)) {
436
- execCmd('cross-env DOCKER_BUILDKIT=1 docker build ' + (noCache ? '--no-cache' : '') + ' -f ' + _paths2.default.ykRootImage + 'Dockerfile --build-arg BASE_IMAGE=' + BI + ' --build-arg YK_VERSIONSHA=' + CS + ' --build-arg YK_ENV=' + CLNENV + ' --build-arg NPM_MODULES_CACHE_ID=' + NMCI + ' -t ' + imageReleaseName + ' .');
451
+ execCmd(prefixCmd + ' DOCKER_BUILDKIT=1 docker build ' + (noCache ? '--no-cache' : '') + ' -f ' + _paths2.default.ykRootImage + Dockerfile + ' --build-arg BASE_IMAGE=' + BI + ' --build-arg YK_VERSIONSHA=' + CS + ' --build-arg YK_ENV=' + CLNENV + ' --build-arg DEP=' + DEP + ' --build-arg NPM_MODULES_CACHE_ID=' + NMCI + ' -t ' + imageReleaseName + ' .');
437
452
  } else {
438
453
  _consola2.default.error('Image build failure!');
439
454
  process.exit(0);
@@ -445,12 +460,12 @@ var run = exports.run = function () {
445
460
 
446
461
  loop(0);
447
462
 
448
- _context6.next = 29;
463
+ _context6.next = 36;
449
464
  return (0, _server.delay)(1000);
450
465
 
451
- case 29:
466
+ case 36:
452
467
 
453
- if (CLNPACK) {
468
+ if (CLNPACK && EXPORT) {
454
469
  if (!(0, _commandExists.sync)('gzip')) {
455
470
  execCmd('docker save > ' + imageReleaseNameSave + '.tar ' + imageReleaseName);
456
471
  } else {
@@ -461,7 +476,7 @@ var run = exports.run = function () {
461
476
  _consola2.default.success('Image tar: ' + imageReleaseNameSave + '.tar');
462
477
  _consola2.default.success('Image name: ' + imageReleaseName);
463
478
 
464
- case 32:
479
+ case 39:
465
480
  case 'end':
466
481
  return _context6.stop();
467
482
  }
@@ -0,0 +1,18 @@
1
+ ARG BASE_IMAGE
2
+ FROM $BASE_IMAGE
3
+
4
+ ARG YK_DOCKERNAME
5
+ ENV YK_DOCKERNAME $YK_DOCKERNAME
6
+ ARG YK_ENV
7
+ ENV YK_ENV $YK_ENV
8
+ ARG YK_ENV
9
+ ENV YK_SERVER_ENV $YK_ENV
10
+
11
+ RUN rm -rf /root/.npm
12
+ RUN rm -rf /root/.npminstall_tarball
13
+
14
+ ARG DEP
15
+ ADD ./$DEP ./
16
+ ADD ./.ykServer ./.ykServer
17
+ ADD ./config ./config
18
+ ADD ./common.static ./common.static
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yakuza0",
3
- "version": "2.22.39",
3
+ "version": "2.22.40-beta.0",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {