underpost 2.8.41 → 2.8.42

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/bin/build.js CHANGED
@@ -19,16 +19,17 @@ const logger = loggerFactory(import.meta);
19
19
 
20
20
  const confName = process.argv[2];
21
21
  const basePath = '../pwa-microservices-template';
22
- const repoName = `engine-${confName.split('dd-')[1]}-private`;
23
- const repoNameBackUp = `engine-${confName.split('dd-')[1]}-cron-backups`;
24
- const gitUrl = `https://${process.env.GITHUB_TOKEN}@github.com/underpostnet/${repoName}.git`;
25
- const gitBackUpUrl = `https://${process.env.GITHUB_TOKEN}@github.com/underpostnet/${repoNameBackUp}.git`;
22
+ const repoName = `engine-${confName.split('dd-')[1]}`;
23
+ const privateRepoName = `${repoName}-private`;
24
+ const privateRepoNameBackUp = `${repoName}-cron-backups`;
25
+ const gitPrivateUrl = `https://${process.env.GITHUB_TOKEN}@github.com/underpostnet/${privateRepoName}.git`;
26
+ const gitPrivateBackUpUrl = `https://${process.env.GITHUB_TOKEN}@github.com/underpostnet/${privateRepoNameBackUp}.git`;
26
27
 
27
28
  logger.info('', {
28
29
  confName,
29
- // gitUrl,
30
30
  repoName,
31
- repoNameBackUp,
31
+ privateRepoName,
32
+ privateRepoNameBackUp,
32
33
  basePath,
33
34
  });
34
35
 
@@ -150,17 +151,17 @@ spec:
150
151
  process.exit(0);
151
152
  }
152
153
  if (process.argv.includes('conf')) {
153
- if (!fs.existsSync(`../${repoName}`)) {
154
- shellExec(`cd .. && git clone ${gitUrl}`, { silent: true });
154
+ if (!fs.existsSync(`../${privateRepoName}`)) {
155
+ shellExec(`cd .. && git clone ${gitPrivateUrl}`, { silent: true });
155
156
  } else {
156
- shellExec(`cd ../${repoName} && git pull`);
157
+ shellExec(`cd ../${privateRepoName} && git pull`);
157
158
  }
158
- const toPath = `../${repoName}/conf/${confName}`;
159
+ const toPath = `../${privateRepoName}/conf/${confName}`;
159
160
  fs.removeSync(toPath);
160
161
  fs.mkdirSync(toPath, { recursive: true });
161
162
  fs.copySync(`./engine-private/conf/${confName}`, toPath);
162
163
  shellExec(
163
- `cd ../${repoName}` +
164
+ `cd ../${privateRepoName}` +
164
165
  ` && git add .` +
165
166
  ` && git commit -m "ci(engine-core-conf): ⚙️ Update ${confName} conf"` +
166
167
  ` && git push`,
@@ -169,16 +170,16 @@ if (process.argv.includes('conf')) {
169
170
  }
170
171
 
171
172
  if (process.argv.includes('cron-backups')) {
172
- if (!fs.existsSync(`../${repoNameBackUp}`)) {
173
- shellExec(`cd .. && git clone ${gitBackUpUrl}`, { silent: true });
173
+ if (!fs.existsSync(`../${privateRepoNameBackUp}`)) {
174
+ shellExec(`cd .. && git clone ${gitPrivateBackUpUrl}`, { silent: true });
174
175
  } else {
175
- shellExec(`cd ../${repoNameBackUp} && git pull`);
176
+ shellExec(`cd ../${privateRepoNameBackUp} && git pull`);
176
177
  }
177
178
  const serverConf = JSON.parse(fs.readFileSync(`./engine-private/conf/${confName}/conf.server.json`, 'utf8'));
178
179
  for (const host of Object.keys(serverConf)) {
179
180
  for (let path of Object.keys(serverConf[host])) {
180
181
  path = path.replaceAll('/', '-');
181
- const toPath = `../${repoNameBackUp}/${host}${path}`;
182
+ const toPath = `../${privateRepoNameBackUp}/${host}${path}`;
182
183
  const fromPath = `./engine-private/cron-backups/${host}${path}`;
183
184
  if (fs.existsSync(fromPath)) {
184
185
  if (fs.existsSync(toPath)) fs.removeSync(toPath);
@@ -188,7 +189,7 @@ if (process.argv.includes('cron-backups')) {
188
189
  }
189
190
  }
190
191
  shellExec(
191
- `cd ../${repoNameBackUp}` +
192
+ `cd ../${privateRepoNameBackUp}` +
192
193
  ` && git add .` +
193
194
  ` && git commit -m "ci(engine-core-cron-backups): ⚙️ Update ${confName} cron backups"` +
194
195
  ` && git push`,
@@ -274,5 +275,9 @@ const { DefaultConf } = await import(`../conf.${confName}.js`);
274
275
 
275
276
  const packageJson = JSON.parse(fs.readFileSync(`${basePath}/package.json`, 'utf8'));
276
277
  packageJson.name = repoName;
277
- fs.writeFileSync(`${basePath}/package.json`, JSON.stringify(packageJson, null, 4), 'utf8');
278
+ fs.writeFileSync(
279
+ `${basePath}/package.json`,
280
+ JSON.stringify(packageJson, null, 4).replaceAll('pwa-microservices-template', repoName),
281
+ 'utf8',
282
+ );
278
283
  }
@@ -58,7 +58,7 @@ services:
58
58
  cpus: '0.25'
59
59
  memory: 20M
60
60
  labels: # labels in Compose file instead of Dockerfile
61
- engine.version: '2.8.41'
61
+ engine.version: '2.8.42'
62
62
  networks:
63
63
  - load-balancer
64
64
 
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.41",
5
+ "version": "2.8.42",
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",
package/src/index.js CHANGED
@@ -22,7 +22,7 @@ class Underpost {
22
22
  * @type {String}
23
23
  * @memberof Underpost
24
24
  */
25
- static version = 'v2.8.41';
25
+ static version = 'v2.8.42';
26
26
  static project = Project;
27
27
 
28
28
  constructor() {}