From 9de1db1d169fa3ef3c98c4b93dd0ea44cdc00969 Mon Sep 17 00:00:00 2001 From: Kipchumba Bett Date: Thu, 19 Dec 2024 09:31:28 +0300 Subject: [PATCH] OZ-573: Dynamically set Gitpod hostnames --- scripts/start.sh | 1 + scripts/utils.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/scripts/start.sh b/scripts/start.sh index 56d1997..6de6305 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -56,6 +56,7 @@ if [[ $INSTALLED_DOCKER_VERSION =~ $MINIMUM_REQUIRED_DOCKER_VERSION_REGEX ]]; th if command -v gp version &> /dev/null; then export GITPOD_ENV="true" export USE_HTTPS="true" + setGitpodHostnames else export GITPOD_ENV="false" fi diff --git a/scripts/utils.sh b/scripts/utils.sh index 6357983..1b24d4a 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -173,6 +173,23 @@ function setNginxHostnames { } +function setGitpodHostnames { + echo "$INFO Gitpod Environment detected, exporting Gitpod hostnames..." + export O3_HOSTNAME="80-${GITPOD_WORKSPACE_URL#https://}" + export ODOO_HOSTNAME="8069-${GITPOD_WORKSPACE_URL#https://}" + export SENAITE_HOSTNAME="8081-${GITPOD_WORKSPACE_URL#https://}" + export ERPNEXT_HOSTNAME="8082-${GITPOD_WORKSPACE_URL#https://}" + export FHIR_ODOO_HOSTNAME="8083-${GITPOD_WORKSPACE_URL#https://}" + export KEYCLOAK_HOSTNAME="8084-${GITPOD_WORKSPACE_URL#https://}" + + echo "→ O3_HOSTNAME=$O3_HOSTNAME" + echo "→ ODOO_HOSTNAME=$ODOO_HOSTNAME" + echo "→ SENAITE_HOSTNAME=$SENAITE_HOSTNAME" + echo "→ ERPNEXT_HOSTNAME=$ERPNEXT_HOSTNAME" + echo "→ FHIR_ODOO_HOSTNAME=$FHIR_ODOO_HOSTNAME" + echo "→ KEYCLOAK_HOSTNAME=$KEYCLOAK_HOSTNAME" +} + function exportScheme() { if [ "$USE_HTTPS" == "true" ]; then export SERVER_SCHEME="https"