Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centralize docker host IP script. #15

Merged
merged 1 commit into from
Dec 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 3 additions & 6 deletions manage
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash

export MSYS_NO_PATHCONV=1

# getDockerHost; for details refer to https://github.com/bcgov/DITP-DevOps/tree/main/code/snippets#getdockerhost
. /dev/stdin <<<"$(cat <(curl -s --raw https://raw.githubusercontent.com/bcgov/DITP-DevOps/main/code/snippets/getDockerHost))"
set -e

SCRIPT_HOME="$(cd "$(dirname "$0")" && pwd)"
Expand Down Expand Up @@ -51,11 +52,7 @@ exportEnvironment() {
export MEDIATOR_AGENT_HTTP_IN_PORT=3000

if [ -z "${PWD_HOST_FQDN}" ]; then
if [[ $(uname) == "Linux" ]] ; then
DOCKERHOST=`docker run --rm --net=host eclipse/che-ip`
else
DOCKERHOST=host.docker.internal
fi
export DOCKERHOST=$(getDockerHost)
export ENV=local
export MEDIATOR_ENDPOINT_URL=http://${DOCKERHOST}:${MEDIATOR_AGENT_HTTP_IN_PORT}
else
Expand Down