Allow to read hostname from config file

This commit is contained in:
Martin Lablans 2022-11-04 13:09:11 +01:00
parent ab3a5790de
commit 6b2168ff11
2 changed files with 8 additions and 2 deletions

View File

@ -59,6 +59,7 @@ if [ -f "$PROJECT/docker-compose.override.yml" ]; then
fi
detectCompose
setHostname
case "$ACTION" in
start)

View File

@ -125,12 +125,17 @@ fail_and_report() {
exit $1
}
setHostname() {
if [ -z "$HOST" ]; then
export HOST=$(hostname -f)
log DEBUG "Using auto-detected hostname $HOST."
fi
}
##Setting Network properties
# currently not needed
#export HOSTIP=$(MSYS_NO_PATHCONV=1 docker run --rm --add-host=host.docker.internal:host-gateway ubuntu cat /etc/hosts | grep 'host.docker.internal' | awk '{print $1}');
export HOST=$(hostname -f)
export PRODUCTION="false";
if [ "$(git branch --show-current)" == "main" ]; then
export PRODUCTION="true";