web: Parameterize build process with env-dependent config files.
This commit is contained in:
parent
cfd5463b4d
commit
c5daa76102
@ -47,7 +47,7 @@ proc loadConfig*(args: Table[string, docopt.Value] = initTable[string, docopt.Va
|
|||||||
port: parseInt(cfg.getVal("port", "8080")),
|
port: parseInt(cfg.getVal("port", "8080")),
|
||||||
pwdCost: cast[int8](parseInt(cfg.getVal("pwd-cost", "11"))),
|
pwdCost: cast[int8](parseInt(cfg.getVal("pwd-cost", "11"))),
|
||||||
knownOrigins: toSeq(knownOriginsArray).mapIt(it.getStr))
|
knownOrigins: toSeq(knownOriginsArray).mapIt(it.getStr))
|
||||||
|
|
||||||
proc initContext(args: Table[string, docopt.Value]): PMApiContext =
|
proc initContext(args: Table[string, docopt.Value]): PMApiContext =
|
||||||
|
|
||||||
var cfg: PMApiConfig
|
var cfg: PMApiConfig
|
||||||
|
3
web/.env.dev
Normal file
3
web/.env.dev
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
VUE_APP_PM_API_BASE=https://pmapi-dev.jdb-labs.com/api
|
||||||
|
VUE_APP_LOG_LEVEL=INFO
|
||||||
|
VUE_APP_API_LOG_LEVEL=ERROR
|
1
web/.env.prod
Symbolic link
1
web/.env.prod
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
.env.production
|
@ -1,3 +1,3 @@
|
|||||||
VUE_APP_PM_API_BASE=https://pm.jdb-labs.com/api
|
VUE_APP_PM_API_BASE=https://pmapi.jdb-labs.com/api
|
||||||
VUE_APP_LOG_LEVEL=INFO
|
VUE_APP_LOG_LEVEL=INFO
|
||||||
VUE_APP_API_LOG_LEVEL=ERROR
|
VUE_APP_API_LOG_LEVEL=ERROR
|
||||||
|
22
web/Makefile
22
web/Makefile
@ -1,23 +1,11 @@
|
|||||||
API_LOG_LEVEL='WARN'
|
|
||||||
LOG_LEVEL='TRACE'
|
|
||||||
|
|
||||||
build-dev:
|
|
||||||
npm run build-dev
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
pwd; \
|
||||||
|
. .env.${TARGET_ENV}; \
|
||||||
|
echo "Using API URL: ${VUE_APP_PM_API_BASE}"; \
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
serve:
|
serve:
|
||||||
VUE_APP_PM_API_BASE=/api \
|
VUE_APP_PM_API_BASE=/api \
|
||||||
VUE_APP_API_LOG_LEVEL=${API_LOG_LEVEL} \
|
VUE_APP_API_LOG_LEVEL=WARN \
|
||||||
VUE_APP_LOG_LEVEL=${LOG_LEVEL} \
|
VUE_APP_LOG_LEVEL=TRACE \
|
||||||
npm run serve
|
npm run serve
|
||||||
|
|
||||||
serve-dev: build-dev
|
|
||||||
(cd dist && npx live-server . --port=8080 --entry-file=index.html --proxy=/api:http://localhost:8081/api --no-browser)
|
|
||||||
|
|
||||||
serve-ssl: build-dev
|
|
||||||
(cd dist && \
|
|
||||||
(local-ssl-proxy --source=8443 --target=8080 & \
|
|
||||||
echo `pwd` && \
|
|
||||||
npx live-server . --port=8080 --entry-file=index.html --proxy=/api:http://localhost:8081/api --no-browser))
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user