Added config support for build script

This commit is contained in:
seefo
2018-06-05 06:53:20 -04:00
parent da34db8095
commit 7fcce4fd26
3 changed files with 34 additions and 18 deletions

1
.gitignore vendored
View File

@@ -7,5 +7,6 @@ dsrc/*
site/*
stationapi/build/*
.setup
config.sh
checksums_*.txt
patch_*.rsp

View File

@@ -2,14 +2,6 @@
basedir=$PWD
PATH=$PATH:$basedir/build/bin
DBSERVICE=
DBUSERNAME=
DBPASSWORD=
HOSTIP=
CLUSTERNAME=
NODEID=
DSRC_DIR=
DATA_DIR=
GIT_URL="https://bitbucket.org/seefoe/"
GIT_REPO_SRC=${GIT_URL}src.git
GIT_REPO_DSRC=${GIT_URL}dsrc.git
@@ -18,6 +10,11 @@ GIT_REPO_DATA=${GIT_URL}data.git
GIT_REPO_CLIENTDATA=${GIT_URL}clientdata.git
GIT_REPO_SITE=${GIT_URL}swg-site.git
# load config for build script
if [ -e "config.sh" ]; then
source config.sh
else
# Debug and Release are for testing and not public servers, they lack optimizations
MODE=Release
#MODE=Debug
@@ -120,20 +117,30 @@ read -p "Do you want to build the config environment now? (y/n) " response
response=${response,,} # tolower
if [[ $response =~ ^(yes|y| ) ]]; then
echo "Enter your IP address (LAN for port forwarding or internal, outside IP for DMZ)"
read HOSTIP
if [[ -z "$HOSTIP" ]]; then
echo "Enter your IP address (LAN for port forwarding or internal, outside IP for DMZ)"
read HOSTIP
fi
echo "Enter the DSN for the database connection "
read DBSERVICE
if [[ -z "$DBSERVICE" ]]; then
echo "Enter the DSN for the database connection "
read DBSERVICE
fi
echo "Enter the database username "
read DBUSERNAME
if [[ -z "$DBUSERNAME" ]]; then
echo "Enter the database username "
read DBUSERNAME
fi
echo "Enter the database password "
read DBPASSWORD
if [[ -z "$DBPASSWORD" ]]; then
echo "Enter the database password "
read DBPASSWORD
fi
echo "Enter a name for the galaxy cluster "
read CLUSTERNAME
if [[ -z "$CLUSTERNAME" ]]; then
echo "Enter a name for the galaxy cluster "
read CLUSTERNAME
fi
if [ -d $basedir/exe ]; then
rm -rf $basedir/exe

8
config.sh.example Normal file
View File

@@ -0,0 +1,8 @@
DBSERVICE=
DBUSERNAME=
DBPASSWORD=
HOSTIP=
CLUSTERNAME=
NODEID=
DSRC_DIR=
DATA_DIR=