@rpcbase/server 0.44.0 → 0.45.0
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.js +1 -2
- package/cli/run_docker.js +2 -4
- package/cli/start_server.js +2 -3
- package/package.json +1 -1
package/bin.js
CHANGED
|
@@ -13,8 +13,7 @@ let is_command = false
|
|
|
13
13
|
const args = yargs(hideBin(process.argv))
|
|
14
14
|
.command("start", "run server/infrastructure", () => {}, (argv) => {
|
|
15
15
|
is_command = true
|
|
16
|
-
|
|
17
|
-
start_server(argv)
|
|
16
|
+
start_server()
|
|
18
17
|
})
|
|
19
18
|
.command("ping", "ping", () => {}, (argv) => {
|
|
20
19
|
is_command = true
|
package/cli/run_docker.js
CHANGED
|
@@ -4,12 +4,10 @@ const path = require("path")
|
|
|
4
4
|
|
|
5
5
|
const is_production = "yes" === process.env.INFRASTRUCTURE_IS_PRODUCTION
|
|
6
6
|
|
|
7
|
-
const run_docker = async(infrastructure_dir, proj_prefix
|
|
7
|
+
const run_docker = async(infrastructure_dir, proj_prefix) => {
|
|
8
8
|
// env
|
|
9
9
|
const env_path = path.relative(infrastructure_dir, path.join(process.cwd(), "./.env"))
|
|
10
10
|
|
|
11
|
-
console.log("ICI ARGS", args)
|
|
12
|
-
|
|
13
11
|
// compose files
|
|
14
12
|
const compose_files = ["-f common.yml"]
|
|
15
13
|
if (is_production) compose_files.push("-f prod.yml")
|
|
@@ -17,11 +15,11 @@ const run_docker = async(infrastructure_dir, proj_prefix, args) => {
|
|
|
17
15
|
|
|
18
16
|
const opts = ["--build", "--remove-orphans"]
|
|
19
17
|
if (!is_production) opts.push("--abort-on-container-exit")
|
|
20
|
-
if (args.detach) opts.push("--detach")
|
|
21
18
|
|
|
22
19
|
const cmd = `docker-compose --env-file ${env_path} -p ${proj_prefix} ${compose_files.join(" ")} up ${opts.join(" ")}`
|
|
23
20
|
|
|
24
21
|
console.log(cmd)
|
|
22
|
+
|
|
25
23
|
try {
|
|
26
24
|
execSync(cmd, {stdio: "inherit", cwd: infrastructure_dir})
|
|
27
25
|
} catch (err) {
|
package/cli/start_server.js
CHANGED
|
@@ -10,7 +10,7 @@ const run_native = require("./run_native")
|
|
|
10
10
|
// TODO: auto create network if necessary
|
|
11
11
|
// docker network create local-network
|
|
12
12
|
|
|
13
|
-
const start_server = async(
|
|
13
|
+
const start_server = async() => {
|
|
14
14
|
|
|
15
15
|
const infrastructure_dir = path.join(process.cwd(), "../infrastructure")
|
|
16
16
|
|
|
@@ -20,11 +20,10 @@ const start_server = async(args) => {
|
|
|
20
20
|
|
|
21
21
|
const runtime = get_runtime()
|
|
22
22
|
|
|
23
|
-
console.log("RUN", runtime)
|
|
24
23
|
if (runtime === "native") {
|
|
25
24
|
run_native(infrastructure_dir, proj_prefix)
|
|
26
25
|
} else {
|
|
27
|
-
run_docker(infrastructure_dir, proj_prefix
|
|
26
|
+
run_docker(infrastructure_dir, proj_prefix)
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
}
|