Rework deploy scripts to correctly build and handle multiple environments.

This commit is contained in:
Jonathan Bernard
2019-09-26 23:23:32 -05:00
parent cfd5463b4d
commit bfcce67788
7 changed files with 21 additions and 6 deletions
+3
View File
@@ -0,0 +1,3 @@
VUE_APP_PM_API_BASE=https://pmapi-dev.jdb-labs.com/v0
VUE_APP_LOG_LEVEL=TRACE
VUE_APP_API_LOG_LEVEL=ERROR
+3
View File
@@ -0,0 +1,3 @@
VUE_APP_PM_API_BASE=https://pmapi.jdb-labs.com/v0
VUE_APP_LOG_LEVEL=INFO
VUE_APP_API_LOG_LEVEL=ERROR
+1 -1
View File
@@ -11,7 +11,7 @@ dist/personal-measure-api.tar.gz:
dist/personal-measure-web.tar.gz:
-mkdir dist
TARGET_ENV=$(TARGET_ENV) make -C web build
(TARGET_ENV=$(TARGET_ENV) ./set-env.sh make -C web build)
tar czf dist/personal-measure-web-${VERSION}.tar.gz -C web/dist .
cp dist/personal-measure-web-${VERSION}.tar.gz dist/personal-measure-web.tar.gz
@@ -211,7 +211,7 @@ proc start*(ctx: PMApiContext): void =
settings:
port = Port(ctx.cfg.port)
appName = "/api"
appName = "/v0"
routes:
Executable
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
if [[ -z $TARGET_ENV ]]; then
echo "TARGET_ENV variable is not set."
exit 1
fi
export $(grep -v '^#' .env.$TARGET_ENV | xargs )
"$@"
-3
View File
@@ -1,3 +0,0 @@
VUE_APP_PM_API_BASE=https://pm.jdb-labs.com/api
VUE_APP_LOG_LEVEL=INFO
VUE_APP_API_LOG_LEVEL=ERROR
+1
View File
@@ -0,0 +1 @@
../.env.prod
+4 -1
View File
@@ -8,7 +8,10 @@ const VERSION = {
module.exports = {
devServer: {
proxy: {
'/api': { target: 'http://localhost:8081' }
'/api': {
pathRewrite: { '^/api': '/v0' },
target: 'http://localhost:8081'
}
},
host: 'localhost',
disableHostCheck: true