underpost 2.8.874 → 2.8.875

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/README.md CHANGED
@@ -51,12 +51,13 @@
51
51
 
52
52
 
53
53
 
54
+
54
55
 
55
56
 
56
57
  <!-- badges -->
57
58
 
58
59
 
59
- [![Node.js CI](https://github.com/underpostnet/engine/actions/workflows/docker-image.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [![Test](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/coverall.yml) [![Downloads](https://img.shields.io/npm/dm/underpost.svg)](https://www.npmjs.com/package/underpost) [![Socket Badge](https://socket.dev/api/badge/npm/package/underpost/2.8.874)](https://socket.dev/npm/package/underpost/overview/2.8.874) [![Coverage Status](https://coveralls.io/repos/github/underpostnet/engine/badge.svg?branch=master)](https://coveralls.io/github/underpostnet/engine?branch=master) [![Version](https://img.shields.io/npm/v/underpost.svg)](https://www.npmjs.org/package/underpost) [![License](https://img.shields.io/npm/l/underpost.svg)](https://www.npmjs.com/package/underpost)
60
+ [![Node.js CI](https://github.com/underpostnet/engine/actions/workflows/docker-image.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [![Test](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/coverall.yml) [![Downloads](https://img.shields.io/npm/dm/underpost.svg)](https://www.npmjs.com/package/underpost) [![Socket Badge](https://socket.dev/api/badge/npm/package/underpost/2.8.875)](https://socket.dev/npm/package/underpost/overview/2.8.875) [![Coverage Status](https://coveralls.io/repos/github/underpostnet/engine/badge.svg?branch=master)](https://coveralls.io/github/underpostnet/engine?branch=master) [![Version](https://img.shields.io/npm/v/underpost.svg)](https://www.npmjs.org/package/underpost) [![License](https://img.shields.io/npm/l/underpost.svg)](https://www.npmjs.com/package/underpost)
60
61
 
61
62
 
62
63
  <!-- end-badges -->
@@ -96,6 +97,7 @@
96
97
 
97
98
 
98
99
 
100
+
99
101
 
100
102
 
101
103
  </div>
@@ -142,7 +144,7 @@ Run dev client server
142
144
  npm run dev
143
145
  ```
144
146
  <!-- -->
145
- ## underpost ci/cd cli v2.8.874
147
+ ## underpost ci/cd cli v2.8.875
146
148
 
147
149
  ### Usage: `underpost [options] [command]`
148
150
  ```
package/bin/deploy.js CHANGED
@@ -368,6 +368,8 @@ try {
368
368
  }
369
369
 
370
370
  case 'version-build': {
371
+ shellCd(`/home/dd/engine`);
372
+ shellExec(`node bin/deploy clean-core-repo`);
371
373
  shellExec(`node bin run kill 4001`);
372
374
  shellExec(`node bin run kill 4002`);
373
375
  shellExec(`node bin run kill 4003`);
@@ -384,8 +386,8 @@ try {
384
386
  logger.error('Test template runner result failed');
385
387
  break;
386
388
  }
387
- shellExec(`node bin/deploy clean-core-repo`);
388
389
  shellCd(`/home/dd/engine`);
390
+ shellExec(`node bin/deploy clean-core-repo`);
389
391
  const originPackageJson = JSON.parse(fs.readFileSync(`package.json`, 'utf8'));
390
392
  const newVersion = process.argv[3] ?? originPackageJson.version;
391
393
  const node = process.argv[4] ?? 'kind-control-plane';
package/cli.md CHANGED
@@ -1,4 +1,4 @@
1
- ## underpost ci/cd cli v2.8.874
1
+ ## underpost ci/cd cli v2.8.875
2
2
 
3
3
  ### Usage: `underpost [options] [command]`
4
4
  ```
@@ -17,7 +17,7 @@ spec:
17
17
  spec:
18
18
  containers:
19
19
  - name: dd-default-development-blue
20
- image: localhost/rockylinux9-underpost:v2.8.874
20
+ image: localhost/rockylinux9-underpost:v2.8.875
21
21
  # resources:
22
22
  # requests:
23
23
  # memory: "124Ki"
@@ -100,7 +100,7 @@ spec:
100
100
  spec:
101
101
  containers:
102
102
  - name: dd-default-development-green
103
- image: localhost/rockylinux9-underpost:v2.8.874
103
+ image: localhost/rockylinux9-underpost:v2.8.875
104
104
  # resources:
105
105
  # requests:
106
106
  # memory: "124Ki"
@@ -17,7 +17,7 @@ spec:
17
17
  spec:
18
18
  containers:
19
19
  - name: dd-test-development-blue
20
- image: localhost/rockylinux9-underpost:v2.8.874
20
+ image: localhost/rockylinux9-underpost:v2.8.875
21
21
  # resources:
22
22
  # requests:
23
23
  # memory: "96294Ki"
@@ -104,7 +104,7 @@ spec:
104
104
  spec:
105
105
  containers:
106
106
  - name: dd-test-development-green
107
- image: localhost/rockylinux9-underpost:v2.8.874
107
+ image: localhost/rockylinux9-underpost:v2.8.875
108
108
  # resources:
109
109
  # requests:
110
110
  # memory: "96294Ki"
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "type": "module",
3
3
  "main": "src/index.js",
4
4
  "name": "underpost",
5
- "version": "2.8.874",
5
+ "version": "2.8.875",
6
6
  "description": "pwa api rest template",
7
7
  "scripts": {
8
8
  "start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
@@ -1,6 +1,6 @@
1
1
  import { commitData } from '../client/components/core/CommonJs.js';
2
2
  import dotenv from 'dotenv';
3
- import { pbcopy, shellExec } from '../server/process.js';
3
+ import { pbcopy, shellCd, shellExec } from '../server/process.js';
4
4
  import { actionInitLog, loggerFactory } from '../server/logger.js';
5
5
  import fs from 'fs-extra';
6
6
  import { getNpmRootPath } from '../server/conf.js';
@@ -49,7 +49,7 @@ class UnderpostRepository {
49
49
  },
50
50
  ) {
51
51
  if (commitType === 'reset') {
52
- pbcopy(shellExec(`git --no-pager log -1 --pretty=%B`, { stdout: true }));
52
+ if (options.copy) pbcopy(shellExec(`git --no-pager log -1 --pretty=%B`, { stdout: true }));
53
53
  shellExec(`cd ${repoPath} && git reset --soft HEAD~${isNaN(parseInt(subModule)) ? 1 : parseInt(subModule)}`);
54
54
  return;
55
55
  }
@@ -138,6 +138,15 @@ class UnderpostRepository {
138
138
  .concat(diffUntrackOutput.toString().split('\n').filter(Boolean))
139
139
  .filter((f) => !deleteFiles.includes(f));
140
140
  },
141
+ privateConfUpdate(deployId) {
142
+ shellCd(`/home/dd/engine`);
143
+ const privateRepoName = `engine-${deployId.split('dd-')[1]}-private`;
144
+ const privateRepoPath = `../${privateRepoName}`;
145
+ if (fs.existsSync(privateRepoPath)) fs.removeSync(privateRepoPath);
146
+ shellExec(`cd .. && underpost clone ${process.env.GITHUB_USERNAME}/${privateRepoName}`);
147
+ shellExec(`cd ${privateRepoPath} && underpost pull . ${process.env.GITHUB_USERNAME}/${privateRepoName}`);
148
+ shellExec(`node bin/build ${deployId} conf`);
149
+ },
141
150
  };
142
151
  }
143
152
 
package/src/cli/run.js CHANGED
@@ -7,6 +7,7 @@ import fs from 'fs-extra';
7
7
  import { range, setPad, timer } from '../client/components/core/CommonJs.js';
8
8
  import UnderpostDeploy from './deploy.js';
9
9
  import UnderpostRootEnv from './env.js';
10
+ import UnderpostRepository from './repository.js';
10
11
 
11
12
  const logger = loggerFactory(import.meta);
12
13
 
@@ -131,7 +132,6 @@ class UnderpostRun {
131
132
  actionInitLog();
132
133
  const baseCommand = options.dev || true ? 'node bin' : 'underpost';
133
134
  shellCd('/home/dd/engine');
134
- shellExec(`node bin/build dd-${path.split('engine-')[1]} conf`);
135
135
  shellExec(`git reset`);
136
136
  shellExec(`${baseCommand} cmt . --empty cd ssh-${path}`);
137
137
  shellExec(`${baseCommand} push . underpostnet/engine`);
@@ -303,6 +303,7 @@ class UnderpostRun {
303
303
  },
304
304
  deploy: async (path, options = UnderpostRun.DEFAULT_OPTION) => {
305
305
  const deployId = path;
306
+ UnderpostRepository.API.privateConfUpdate(deployId);
306
307
  const currentTraffic = UnderpostDeploy.API.getCurrentTraffic(deployId);
307
308
  const targetTraffic = currentTraffic === 'blue' ? 'green' : 'blue';
308
309
  const env = 'production';
package/src/index.js CHANGED
@@ -35,7 +35,7 @@ class Underpost {
35
35
  * @type {String}
36
36
  * @memberof Underpost
37
37
  */
38
- static version = 'v2.8.874';
38
+ static version = 'v2.8.875';
39
39
  /**
40
40
  * Repository cli API
41
41
  * @static