Skip to content

Commit

Permalink
OZ-573: Dynamically set Gitpod hostnames
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliouzbett committed Dec 19, 2024
1 parent 3f893d0 commit 9de1db1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 9de1db1

Please sign in to comment.