yakuza0 2.22.39 → 2.22.40-beta.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/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, 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) {
@@ -405,12 +404,50 @@ var run = exports.run = function () {
405
404
  NMCI = 'nm_' + (0, _server.md5)((0, _stringify2.default)(obj.dependencies) + (0, _stringify2.default)(obj.peerDependencies) + (0, _stringify2.default)(obj.devDependencies)).substring(0, 6);
406
405
  CLNVERSION = process.env.CLN_IMAGE_VERSION || obj.version;
407
406
  } catch (e) {}
407
+ projectName = process.env.CLN_IMAGE_NAME || projectName;
408
408
  imageReleaseName = projectName + ':' + CLNVERSION;
409
409
  imageReleaseNameSave = projectName + '_' + CLNVERSION;
410
- BI = isInner ? 'fe-repo.inner.px.nfjbill.ren:5000/cln-server:0.6.2' : 'nfjbill/cln-server:0.6.2';
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;
415
+ EXPORT = process.env.CLN_IMAGE_EXPORT !== "false";
416
+ DKY = process.env.CLN_IMAGE_DKY === "true";
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";
421
+
422
+ if (_os2.default.platform() === 'win32') {
423
+ prefixCmd = "cross-env ";
424
+ suffixCmd = "";
425
+ }
426
+
427
+ if (DEP) {
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
+ execCmd('docker load < ' + p);
435
+ });
436
+ }
437
+
438
+ fileStr = '-f ' + _paths2.default.ykRootImage + Dockerfile;
439
+
440
+
441
+ if (DKY) {
442
+ buildkit = '';
443
+ fileStr = '';
444
+ EXPORT = false;
445
+ execCmd('cp -rfp ' + _paths2.default.ykRootImage + Dockerfile + ' ./Dockerfile');
446
+ execCmd('cp -rfp ' + _paths2.default.ykRootImage + '.dockerignore ./');
447
+ }
411
448
 
412
449
  if ((0, _commandExists.sync)('docker')) {
413
- _context6.next = 22;
450
+ _context6.next = 36;
414
451
  break;
415
452
  }
416
453
 
@@ -418,22 +455,22 @@ var run = exports.run = function () {
418
455
  process.exit(1);
419
456
  return _context6.abrupt('return');
420
457
 
421
- case 22:
422
- if (!(0, _commandExists.sync)('pxnpm')) {
458
+ case 36:
459
+ if (!(0, _commandExists.sync)('pxnpm') && !DEP) {
423
460
  execCmd(isInner ? 'npm i -g pxnpm --registry=http://fe-repo.inner.px.nfjbill.ren:5507' : 'npm i -g pxnpm');
424
461
  }
425
- if (!(0, _commandExists.sync)('cross-env')) {
462
+ if (!(0, _commandExists.sync)('cross-env') && !DEP) {
426
463
  execCmd('pxnpm i -g cross-env');
427
464
  }
428
465
 
429
466
  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');
467
+ 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');
431
468
  }
432
469
 
433
470
  loop = function loop(i) {
434
471
  try {
435
472
  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 + ' .');
473
+ 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);
437
474
  } else {
438
475
  _consola2.default.error('Image build failure!');
439
476
  process.exit(0);
@@ -445,12 +482,12 @@ var run = exports.run = function () {
445
482
 
446
483
  loop(0);
447
484
 
448
- _context6.next = 29;
485
+ _context6.next = 43;
449
486
  return (0, _server.delay)(1000);
450
487
 
451
- case 29:
488
+ case 43:
452
489
 
453
- if (CLNPACK) {
490
+ if (CLNPACK && EXPORT) {
454
491
  if (!(0, _commandExists.sync)('gzip')) {
455
492
  execCmd('docker save > ' + imageReleaseNameSave + '.tar ' + imageReleaseName);
456
493
  } else {
@@ -461,7 +498,7 @@ var run = exports.run = function () {
461
498
  _consola2.default.success('Image tar: ' + imageReleaseNameSave + '.tar');
462
499
  _consola2.default.success('Image name: ' + imageReleaseName);
463
500
 
464
- case 32:
501
+ case 46:
465
502
  case 'end':
466
503
  return _context6.stop();
467
504
  }
@@ -0,0 +1,15 @@
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
+ ARG DEP
12
+ ADD $DEP ./
13
+ ADD ./.ykServer ./.ykServer
14
+ ADD ./config ./config
15
+ 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.1",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {