yakuza0 2.22.15-beta.1 → 2.22.15-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.
Files changed (2) hide show
  1. package/cli/index.js +22 -7
  2. package/package.json +2 -1
package/cli/index.js CHANGED
@@ -322,7 +322,7 @@ var run = exports.run = function () {
322
322
  }());
323
323
 
324
324
  _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 _callee5() {
325
- var _connectionTester$tes, isInner, CS, CLNENV, noCache, CLNWORKERS, CLNVERSION, pkg, NMCI, projectName, obj, imageReleaseName, imageReleaseNameSave, BI;
325
+ var _connectionTester$tes, isInner, CS, CLNENV, noCache, CLNWORKERS, TRY_TIMES, CLNVERSION, pkg, NMCI, projectName, obj, imageReleaseName, imageReleaseNameSave, BI, loop;
326
326
 
327
327
  return _regenerator2.default.wrap(function _callee5$(_context5) {
328
328
  while (1) {
@@ -333,6 +333,7 @@ var run = exports.run = function () {
333
333
  CLNENV = process.env.CLN_IMAGE_ENV || 'docker';
334
334
  noCache = process.env.NO_CACHE === '1';
335
335
  CLNWORKERS = process.env.CLN_IMAGE_WORKERS || '2';
336
+ TRY_TIMES = process.env.TRY_TIMES || '3';
336
337
  CLNVERSION = process.env.CLN_IMAGE_VERSION || CS;
337
338
  pkg = _paths2.default.read(_paths2.default.appPackageJson);
338
339
  NMCI = 'nm_' + (0, _server.md5)(pkg).substring(0, 6);
@@ -350,7 +351,7 @@ var run = exports.run = function () {
350
351
  BI = isInner ? 'fe-repo.inner.px.nfjbill.ren:5000/cln-server:0.5.4' : 'nfjbill/cln-server:0.5.4';
351
352
 
352
353
  if ((0, _commandExists.sync)('docker')) {
353
- _context5.next = 17;
354
+ _context5.next = 18;
354
355
  break;
355
356
  }
356
357
 
@@ -358,7 +359,7 @@ var run = exports.run = function () {
358
359
  process.exit(1);
359
360
  return _context5.abrupt('return');
360
361
 
361
- case 17:
362
+ case 18:
362
363
  if (!(0, _commandExists.sync)('pxnpm')) {
363
364
  execCmd(isInner ? 'npm i -g pxnpm --registry=http://fe-repo.inner.px.nfjbill.ren:5507' : 'npm i -g pxnpm');
364
365
  }
@@ -367,12 +368,26 @@ var run = exports.run = function () {
367
368
  }
368
369
 
369
370
  execCmd('cross-env YK_ENV=' + CLNENV + ' YK_SERVER_ENV=' + CLNENV + ' YK_VERSIONSHA=' + CS + ' YK_DOCKERNAME=' + CS + ' YK_MACHINE_TYPE=workstation YK0_env=docker pxnpm run build -workers=' + CLNWORKERS);
370
- 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 + ' .');
371
371
 
372
- _context5.next = 23;
372
+ loop = function loop(i) {
373
+ try {
374
+ if (i < parseInt(TRY_TIMES)) {
375
+ 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 + ' .');
376
+ } else {
377
+ _consola2.default.error('Image build failure!');
378
+ process.exit(0);
379
+ }
380
+ } catch (e) {
381
+ loop(i + 1);
382
+ }
383
+ };
384
+
385
+ loop(0);
386
+
387
+ _context5.next = 25;
373
388
  return (0, _server.delay)(1000);
374
389
 
375
- case 23:
390
+ case 25:
376
391
 
377
392
  if (!(0, _commandExists.sync)('gzip')) {
378
393
  execCmd('docker save > ' + imageReleaseNameSave + '.tar ' + imageReleaseName);
@@ -384,7 +399,7 @@ var run = exports.run = function () {
384
399
  _consola2.default.info('Image name: ' + imageReleaseName);
385
400
  _consola2.default.info('Image production completed!');
386
401
 
387
- case 27:
402
+ case 29:
388
403
  case 'end':
389
404
  return _context5.stop();
390
405
  }
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "yakuza0",
3
- "version": "2.22.15-beta.1",
3
+ "version": "2.22.15-beta.2",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
+ "base": "babel --no-babelrc src -d /Users/ningfujun/work/repo/web/CLN_BASE_TEST/node_modules/yakuza0 -w --presets=env --plugins=transform-runtime,transform-object-rest-spread,add-module-exports",
7
8
  "build": "babel --no-babelrc src -d . --presets=env --plugins=transform-runtime,transform-object-rest-spread,add-module-exports",
8
9
  "pub:beta": "npm run build && npm version prerelease --preid=beta && npm publish --tag beta",
9
10
  "pub:hotfix": "npm run build && npm version prerelease --preid=hotfix && npm publish --tag hotfix",