Merge pull request 'feature/complete-develop-merge' (#142) from feature/complete-develop-merge into develop
Reviewed-on: http://85.143.176.51:3000/free-land/front-end/pulls/142
This commit is contained in:
commit
bbe6bcca51
@ -1,6 +1,6 @@
|
||||
REACT_APP_CMS_BASE_URL=EXT_CMS_BASE_URL
|
||||
REACT_APP_CMS_APP_NAME=EXT_CMS_APP_NAME
|
||||
REACT_APP_OPENID_PROVIDER_URL=EXT_OPENID_PROVIDER_URL
|
||||
REACT_APP_INTEGRATOR_URL=EXT_INTEGRATOR_URL
|
||||
REACT_APP_INTEGRATOR_API_VERSION=EXT_INTEGRATOR_API_VERSION
|
||||
REACT_APP_GRAPHQL_URL=EXT_GRAPHQL_URL
|
||||
REACT_APP_CMS_BASE_URL=http://scipaper.ru
|
||||
REACT_APP_CMS_APP_NAME=scipaper
|
||||
REACT_APP_OPENID_PROVIDER_URL=http://auth.techpal.ru/auth/realms/master/protocol/openid-connect/auth?client_id=techpal&response_type=code
|
||||
REACT_APP_INTEGRATOR_URL=http://scipaper.ru
|
||||
REACT_APP_INTEGRATOR_API_VERSION=/v1
|
||||
REACT_APP_GRAPHQL_URL=/graphql
|
||||
|
2
Makefile
2
Makefile
@ -1,4 +1,4 @@
|
||||
PROJECT_NAME=freeland-frontend
|
||||
PROJECT_NAME=scipaper-frontend
|
||||
|
||||
setup:
|
||||
npm i
|
||||
|
@ -1,35 +1,35 @@
|
||||
#!/bin/bash
|
||||
# no verbose
|
||||
set +x
|
||||
# config
|
||||
envFilename='.env.production'
|
||||
resolvingPath='/usr/share/nginx/html'
|
||||
function apply_path {
|
||||
# read all config file
|
||||
while read line; do
|
||||
# no comment or not empty
|
||||
if [ "${line:0:1}" == "#" ] || [ "${line}" == "" ]; then
|
||||
echo "Skiped line $line"
|
||||
continue
|
||||
fi
|
||||
|
||||
# split
|
||||
configName="$(cut -d'=' -f1 <<<"$line")"
|
||||
configValue="$(cut -d'=' -f2 <<<"$line")"
|
||||
# get system env
|
||||
envValue=$(env | grep "^$configName=" | grep -oP '(?!=)(?<==).*$');
|
||||
if [ -z "$configValue" ]; then
|
||||
echo "Empty env value met: $configName:$configValue"
|
||||
fi
|
||||
|
||||
# if config found
|
||||
if [ -n "$configValue" ] && [ -n "$envValue" ]; then
|
||||
# replace all
|
||||
echo "Replace: ${configValue} with: ${envValue}"
|
||||
find $resolvingPath \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "s#$configValue#$envValue#g"
|
||||
fi
|
||||
done < $envFilename
|
||||
}
|
||||
apply_path
|
||||
echo "Starting React Application"
|
||||
#! /bin/bash
|
||||
# no verbose
|
||||
set +x
|
||||
# config
|
||||
envFilename='.env.production'
|
||||
resolvingPath='/usr/share/nginx/html'
|
||||
function apply_path {
|
||||
# read all config file
|
||||
while read line; do
|
||||
# no comment or not empty
|
||||
if [ "${line:0:1}" == "#" ] || [ "${line}" == "" ]; then
|
||||
echo "Skiped line $line"
|
||||
continue
|
||||
fi
|
||||
|
||||
# split
|
||||
configName="$(cut -d'=' -f1 <<<"$line")"
|
||||
configValue="$(cut -d'=' -f2 <<<"$line")"
|
||||
# get system env
|
||||
envValue=$(env | grep "^$configName=" | grep -oP '(?!=)(?<==).*$');
|
||||
if [ -z "$configValue" ]; then
|
||||
echo "Empty env value met: $configName:$configValue"
|
||||
fi
|
||||
|
||||
# if config found
|
||||
if [ -n "$configValue" ] && [ -n "$envValue" ]; then
|
||||
# replace all
|
||||
echo "Replace: ${configValue} with: ${envValue}"
|
||||
find $resolvingPath \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "s#$configValue#$envValue#g"
|
||||
fi
|
||||
done < $envFilename
|
||||
}
|
||||
apply_path
|
||||
echo "Starting React Application"
|
||||
exec "$@"
|
Loading…
x
Reference in New Issue
Block a user