@onivoro/onix 20.5.54 → 20.5.56
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/executors.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"typeorm-db-client": {
|
|
14
14
|
"implementation": "./src/executors/typeorm-db-client/executor",
|
|
15
|
-
"schema": "./src/executors/typeorm/schema.json",
|
|
15
|
+
"schema": "./src/executors/typeorm-db-client/schema.json",
|
|
16
16
|
"description": "typeorm-db-client"
|
|
17
17
|
},
|
|
18
18
|
"docker-run": {
|
package/package.json
CHANGED
|
@@ -4,22 +4,32 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const load_env_file_function_1 = require("../../functions/load-env-file.function");
|
|
5
5
|
const executor_factory_function_1 = require("../../functions/executor-factory.function");
|
|
6
6
|
const child_process_1 = require("child_process");
|
|
7
|
+
const os_1 = require("os");
|
|
7
8
|
exports.default = (0, executor_factory_function_1.executorFactory)((options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
8
|
-
const { envFile, host
|
|
9
|
+
const { envFile, host, db, password, port, user, type, httpPort } = options || {};
|
|
9
10
|
if (envFile) {
|
|
10
11
|
(0, load_env_file_function_1.loadEnvFile)(envFile);
|
|
11
12
|
}
|
|
13
|
+
const http = env(httpPort);
|
|
12
14
|
(0, child_process_1.execSync)(`docker` + ' ' + [
|
|
13
15
|
'run',
|
|
14
|
-
`-p ${
|
|
15
|
-
`--env="DV_HOST=${
|
|
16
|
-
`--env="DV_DB=${
|
|
17
|
-
`--env="DV_PASSWORD=${
|
|
18
|
-
`--env="DV_PORT=${
|
|
19
|
-
`--env="DV_USER=${
|
|
20
|
-
`--env="DV_TYPE=${
|
|
21
|
-
`--env="PORT=${
|
|
22
|
-
|
|
16
|
+
`-p ${http}:${http}`,
|
|
17
|
+
`--env="DV_HOST=${env(host)}"`,
|
|
18
|
+
`--env="DV_DB=${env(db)}"`,
|
|
19
|
+
`--env="DV_PASSWORD=${env(password)}"`,
|
|
20
|
+
`--env="DV_PORT=${env(port)}"`,
|
|
21
|
+
`--env="DV_USER=${env(user)}"`,
|
|
22
|
+
`--env="DV_TYPE=${env(type)}"`,
|
|
23
|
+
`--env="PORT=${http}"`,
|
|
24
|
+
`icedlee337/datavore:${((0, os_1.arch)() === 'arm64') ? 'arm64v8' : 'amd64'}`
|
|
23
25
|
].join(' '));
|
|
24
26
|
}));
|
|
27
|
+
function env(value) {
|
|
28
|
+
if (!value) {
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
if (value.toString().includes('process.env')) {
|
|
32
|
+
return eval(value);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
25
35
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/typeorm-db-client/executor.ts"],"names":[],"mappings":";;;AAEA,mFAAqE;AACrE,yFAA4E;AAC5E,iDAAyC;
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/typeorm-db-client/executor.ts"],"names":[],"mappings":";;;AAEA,mFAAqE;AACrE,yFAA4E;AAC5E,iDAAyC;AACzC,2BAA0B;AAE1B,kBAAe,IAAA,2CAAe,EAAC,CAC7B,OAAuB,EACvB,OAAwB,EACxB,EAAE;IACF,MAAM,EACJ,OAAO,EACP,IAAI,EACJ,EAAE,EACF,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,QAAQ,EACT,GAAG,OAAO,IAAI,EAAE,CAAC;IAElB,IAAI,OAAO,EAAE,CAAC;QACZ,IAAA,oCAAW,EAAC,OAAO,CAAC,CAAC;IACvB,CAAC;IAED,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC;IAE3B,IAAA,wBAAQ,EAAC,QAAQ,GAAG,GAAG,GAAG;QACxB,KAAK;QACL,MAAM,IAAI,IAAI,IAAI,EAAE;QACpB,kBAAkB,GAAG,CAAC,IAAI,CAAC,GAAG;QAC9B,gBAAgB,GAAG,CAAC,EAAE,CAAC,GAAG;QAC1B,sBAAsB,GAAG,CAAC,QAAQ,CAAC,GAAG;QACtC,kBAAkB,GAAG,CAAC,IAAI,CAAC,GAAG;QAC9B,kBAAkB,GAAG,CAAC,IAAI,CAAC,GAAG;QAC9B,kBAAkB,GAAG,CAAC,IAAI,CAAC,GAAG;QAC9B,eAAe,IAAI,GAAG;QACtB,uBAAuB,CAAC,IAAA,SAAI,GAAE,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE;KACpE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAEf,CAAC,CAAA,CAAC,CAAC;AAEH,SAAS,GAAG,CAAC,KAAa;IACxB,IAAG,CAAC,KAAK,EAAE,CAAC;QACV,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;QAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export interface ExecutorSchema {
|
|
2
|
+
db: string;
|
|
2
3
|
envFile?: string;
|
|
3
|
-
host
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
httpPort: number;
|
|
4
|
+
host: string;
|
|
5
|
+
httpPort: string;
|
|
6
|
+
password: string;
|
|
7
|
+
port: string;
|
|
8
|
+
type: string;
|
|
9
|
+
user: string;
|
|
10
10
|
}
|
|
@@ -11,42 +11,48 @@
|
|
|
11
11
|
},
|
|
12
12
|
"host": {
|
|
13
13
|
"type": "string",
|
|
14
|
-
"description": "Database host
|
|
15
|
-
"default": "localhost"
|
|
14
|
+
"description": "Database host"
|
|
16
15
|
},
|
|
17
16
|
"port": {
|
|
18
|
-
"type": "
|
|
19
|
-
"description": "Database port
|
|
20
|
-
"default": 5432
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "Database port"
|
|
21
19
|
},
|
|
22
20
|
"httpPort": {
|
|
23
|
-
"type": "
|
|
24
|
-
"description": "Local port to accept HTTP traffic"
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "Local port to accept HTTP traffic"
|
|
25
23
|
},
|
|
26
|
-
"
|
|
24
|
+
"user": {
|
|
27
25
|
"type": "string",
|
|
28
|
-
"description": "Database username
|
|
29
|
-
"default": "postgres"
|
|
26
|
+
"description": "Database username"
|
|
30
27
|
},
|
|
31
28
|
"password": {
|
|
32
29
|
"type": "string",
|
|
33
|
-
"description": "Database password
|
|
34
|
-
"default": ""
|
|
30
|
+
"description": "Database password"
|
|
35
31
|
},
|
|
36
|
-
"
|
|
32
|
+
"db": {
|
|
37
33
|
"type": "string",
|
|
38
|
-
"description": "Database name
|
|
39
|
-
"default": "postgres"
|
|
34
|
+
"description": "Database name"
|
|
40
35
|
},
|
|
41
36
|
"type": {
|
|
42
37
|
"type": "string",
|
|
43
|
-
"description": "Database type
|
|
44
|
-
"
|
|
45
|
-
|
|
38
|
+
"description": "Database type",
|
|
39
|
+
"enum": [
|
|
40
|
+
"postgres",
|
|
41
|
+
"mysql",
|
|
42
|
+
"mariadb",
|
|
43
|
+
"sqlite",
|
|
44
|
+
"mssql",
|
|
45
|
+
"oracle"
|
|
46
|
+
]
|
|
46
47
|
}
|
|
47
48
|
},
|
|
48
49
|
"required": [
|
|
49
|
-
"
|
|
50
|
-
"
|
|
50
|
+
"db",
|
|
51
|
+
"host",
|
|
52
|
+
"httpPort",
|
|
53
|
+
"password",
|
|
54
|
+
"port",
|
|
55
|
+
"type",
|
|
56
|
+
"user"
|
|
51
57
|
]
|
|
52
|
-
}
|
|
58
|
+
}
|