yakuza0 2.22.40-beta.0 → 2.22.40-beta.2

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
@@ -139,7 +139,6 @@ var gi = function () {
139
139
  _paths2.default.interfereFile.forEach(function (p) {
140
140
  _rimraf2.default.sync(p);
141
141
  });
142
-
143
142
  _context.next = 11;
144
143
  return (0, _inclusive2.default)({
145
144
  apps: apps,
@@ -368,7 +367,7 @@ var run = exports.run = function () {
368
367
  })));
369
368
 
370
369
  _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, DEP, EXPORT, Dockerfile, prefixCmd, loop;
370
+ var isTestInner, res, inner, CS, isInner, CLNENV, CLNBUILD, CLNPACK, noCache, CLNWORKERS, TRY_TIMES, CLNVERSION, pkg, NMCI, projectName, obj, imageReleaseName, imageReleaseNameSave, BI, preLoad, DEP, EXPORT, DKY, Dockerfile, buildkit, prefixCmd, suffixCmd, fileStr, loop;
372
371
  return _regenerator2.default.wrap(function _callee6$(_context6) {
373
372
  while (1) {
374
373
  switch (_context6.prev = _context6.next) {
@@ -408,18 +407,49 @@ var run = exports.run = function () {
408
407
  projectName = process.env.CLN_IMAGE_NAME || projectName;
409
408
  imageReleaseName = projectName + ':' + CLNVERSION;
410
409
  imageReleaseNameSave = projectName + '_' + CLNVERSION;
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;
410
+ 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');
411
+ preLoad = (process.env.CLN_IMAGE_LOAD || '').split(',');
412
+ // let BI = process.env.CLN_IMAGE_BI
413
+
414
+ DEP = process.env.CLN_IMAGE_DEP === undefined ? false : process.env.CLN_IMAGE_DEP;
413
415
  EXPORT = process.env.CLN_IMAGE_EXPORT !== "false";
416
+ DKY = process.env.CLN_IMAGE_DKY === "true";
414
417
  Dockerfile = "Dockerfile";
418
+ buildkit = "DOCKER_BUILDKIT=1";
419
+ prefixCmd = "";
420
+ suffixCmd = process.env.CLN_IMAGE_SUFFIX !== undefined ? process.env.CLN_IMAGE_SUFFIX : " >/dev/null 2>&1";
415
421
 
422
+ if (_os2.default.platform() === 'win32') {
423
+ prefixCmd = "cross-env ";
424
+ suffixCmd = "";
425
+ }
416
426
 
417
427
  if (DEP) {
418
428
  Dockerfile = "Dockerfile_DEP";
429
+ BI = BI || "fe-repo.inner.px.nfjbill.ren:5000/cln-server:0.6.2";
430
+ }
431
+
432
+ if (preLoad.length > 0) {
433
+ preLoad.forEach(function (p) {
434
+ if (p) {
435
+ execCmd('docker load < ' + p);
436
+ }
437
+ });
438
+ }
439
+
440
+ fileStr = '-f ' + _paths2.default.ykRootImage + Dockerfile;
441
+
442
+
443
+ if (DKY) {
444
+ buildkit = '';
445
+ fileStr = '';
446
+ EXPORT = false;
447
+ execCmd('cp -rfp ' + _paths2.default.ykRootImage + Dockerfile + ' ./Dockerfile');
448
+ execCmd('cp -rfp ' + _paths2.default.ykRootImage + '.dockerignore ./');
419
449
  }
420
450
 
421
451
  if ((0, _commandExists.sync)('docker')) {
422
- _context6.next = 27;
452
+ _context6.next = 36;
423
453
  break;
424
454
  }
425
455
 
@@ -427,7 +457,7 @@ var run = exports.run = function () {
427
457
  process.exit(1);
428
458
  return _context6.abrupt('return');
429
459
 
430
- case 27:
460
+ case 36:
431
461
  if (!(0, _commandExists.sync)('pxnpm') && !DEP) {
432
462
  execCmd(isInner ? 'npm i -g pxnpm --registry=http://fe-repo.inner.px.nfjbill.ren:5507' : 'npm i -g pxnpm');
433
463
  }
@@ -435,20 +465,14 @@ var run = exports.run = function () {
435
465
  execCmd('pxnpm i -g cross-env');
436
466
  }
437
467
 
438
- prefixCmd = "cross-env ";
439
-
440
- if (!DEP) {
441
- prefixCmd = "";
442
- }
443
-
444
468
  if (CLNBUILD) {
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');
469
+ 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 + ' npm run build');
446
470
  }
447
471
 
448
472
  loop = function loop(i) {
449
473
  try {
450
474
  if (i < parseInt(TRY_TIMES)) {
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 + ' .');
475
+ execCmd(prefixCmd + ' ' + buildkit + ' docker build ' + (noCache ? '--no-cache' : '') + ' ' + fileStr + ' --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 + ' . ' + suffixCmd);
452
476
  } else {
453
477
  _consola2.default.error('Image build failure!');
454
478
  process.exit(0);
@@ -460,10 +484,10 @@ var run = exports.run = function () {
460
484
 
461
485
  loop(0);
462
486
 
463
- _context6.next = 36;
487
+ _context6.next = 43;
464
488
  return (0, _server.delay)(1000);
465
489
 
466
- case 36:
490
+ case 43:
467
491
 
468
492
  if (CLNPACK && EXPORT) {
469
493
  if (!(0, _commandExists.sync)('gzip')) {
@@ -476,7 +500,7 @@ var run = exports.run = function () {
476
500
  _consola2.default.success('Image tar: ' + imageReleaseNameSave + '.tar');
477
501
  _consola2.default.success('Image name: ' + imageReleaseName);
478
502
 
479
- case 39:
503
+ case 46:
480
504
  case 'end':
481
505
  return _context6.stop();
482
506
  }
@@ -8,11 +8,8 @@ ENV YK_ENV $YK_ENV
8
8
  ARG YK_ENV
9
9
  ENV YK_SERVER_ENV $YK_ENV
10
10
 
11
- RUN rm -rf /root/.npm
12
- RUN rm -rf /root/.npminstall_tarball
13
-
14
11
  ARG DEP
15
- ADD ./$DEP ./
12
+ ADD $DEP ./
16
13
  ADD ./.ykServer ./.ykServer
17
14
  ADD ./config ./config
18
15
  ADD ./common.static ./common.static
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yakuza0",
3
- "version": "2.22.40-beta.0",
3
+ "version": "2.22.40-beta.2",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {