-
Notifications
You must be signed in to change notification settings - Fork 8
/
cluster-data-gen.js
34 lines (26 loc) · 761 Bytes
/
cluster-data-gen.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'use strict'
//const fs=require('fs')
const env = process.env
const imageData = {
host: env.IMAGE_HOST_ALIAS || env.IMAGE_HOST,
repo: env.IMAGE_REPO,
}
if (env.IMAGE_AUTH_USER) imageData.auth = {
"user_name": env.IMAGE_AUTH_USER,
password: env.IMAGE_AUTH_PASSWORD || "",
}
const deploy = {replica: env.CLIENT_REPLICAS || 1 }
if (env.CLUSTER_NS) deploy.namespace = env.CLUSTER_NS
if (env.CLUSTER_DEPLOYNAME) deploy.name = env.CLUSTER_DEPLOYNAME
const data = {
stage: env.STAGE,
"coordinator_endpoint": env.COORDINATOR_SERV,
coordinator: {
endpoint: env.COORDINATOR_EP,
port: env.COORDINATOR_PORT || 50055,
},
"circuit_name": env.CIRCUIT || "block",
image: imageData,
deploy
}
console.log(JSON.stringify(data, null, '\t'))