underpost 2.8.612 → 2.8.613
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/docker-compose.yml +1 -1
- package/package.json +1 -1
- package/src/cli/env.js +8 -2
- package/src/cli/image.js +6 -0
- package/src/index.js +1 -1
package/docker-compose.yml
CHANGED
package/package.json
CHANGED
package/src/cli/env.js
CHANGED
|
@@ -28,7 +28,10 @@ class UnderpostRootEnv {
|
|
|
28
28
|
get(key) {
|
|
29
29
|
const exeRootPath = `${getNpmRootPath()}/underpost`;
|
|
30
30
|
const envPath = `${exeRootPath}/.env`;
|
|
31
|
-
if (!fs.existsSync(envPath))
|
|
31
|
+
if (!fs.existsSync(envPath)) {
|
|
32
|
+
logger.error(`Unable to find underpost root environment`);
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
32
35
|
const env = dotenv.parse(fs.readFileSync(envPath, 'utf8'));
|
|
33
36
|
logger.info(`${key}(${typeof env[key]})`, env[key]);
|
|
34
37
|
return env[key];
|
|
@@ -36,7 +39,10 @@ class UnderpostRootEnv {
|
|
|
36
39
|
list() {
|
|
37
40
|
const exeRootPath = `${getNpmRootPath()}/underpost`;
|
|
38
41
|
const envPath = `${exeRootPath}/.env`;
|
|
39
|
-
if (!fs.existsSync(envPath))
|
|
42
|
+
if (!fs.existsSync(envPath)) {
|
|
43
|
+
logger.error(`Unable to find underpost root environment`);
|
|
44
|
+
return {};
|
|
45
|
+
}
|
|
40
46
|
const env = dotenv.parse(fs.readFileSync(envPath, 'utf8'));
|
|
41
47
|
logger.info('underpost root', env);
|
|
42
48
|
return env;
|
package/src/cli/image.js
CHANGED
|
@@ -5,9 +5,12 @@ import dotenv from 'dotenv';
|
|
|
5
5
|
import { getNpmRootPath } from '../server/conf.js';
|
|
6
6
|
import { timer } from '../client/components/core/CommonJs.js';
|
|
7
7
|
import UnderpostRootEnv from './env.js';
|
|
8
|
+
import { loggerFactory } from '../server/logger.js';
|
|
8
9
|
|
|
9
10
|
dotenv.config();
|
|
10
11
|
|
|
12
|
+
const logger = loggerFactory(import.meta);
|
|
13
|
+
|
|
11
14
|
class UnderpostImage {
|
|
12
15
|
static API = {
|
|
13
16
|
dockerfile: {
|
|
@@ -52,6 +55,7 @@ class UnderpostImage {
|
|
|
52
55
|
shellExec(`cd ${path} && sudo kind load image-archive ${tarFile}`);
|
|
53
56
|
},
|
|
54
57
|
async script(deployId = 'default', env = 'development', options = { run: false, build: false }) {
|
|
58
|
+
let attempts = 0;
|
|
55
59
|
if (deployId === 'service') {
|
|
56
60
|
const _deployId = UnderpostRootEnv.API.get('deploy-id');
|
|
57
61
|
const _env = UnderpostRootEnv.API.get('deploy-env');
|
|
@@ -61,6 +65,8 @@ class UnderpostImage {
|
|
|
61
65
|
if (_env) env = _env;
|
|
62
66
|
} else {
|
|
63
67
|
await timer(30 * 1000);
|
|
68
|
+
attempts++;
|
|
69
|
+
logger.info('Deploy env status attempt', attempts);
|
|
64
70
|
return await UnderpostImage.API.dockerfile.script(deployId, env, options);
|
|
65
71
|
}
|
|
66
72
|
}
|