From 5bd3f36bd8cfc4c76a66ac407085305dcb25c463 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Thu, 13 Oct 2016 21:15:14 +0300 Subject: [PATCH] fixed build-and-test-all script --- _build-and-test-all.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/_build-and-test-all.sh b/_build-and-test-all.sh index 2676f74..7120f90 100755 --- a/_build-and-test-all.sh +++ b/_build-and-test-all.sh @@ -2,6 +2,17 @@ set -e +if [ -z "$DOCKER_HOST_IP" ] ; then + if [ -z "$DOCKER_HOST" ] ; then + export DOCKER_HOST_IP=`hostname` + else + echo using ${DOCKER_HOST?} + XX=${DOCKER_HOST%\:*} + export DOCKER_HOST_IP=${XX#tcp\:\/\/} + fi + echo set DOCKER_HOST_IP $DOCKER_HOST_IP +fi + DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DOCKER_COMPOSE="docker-compose -p event-sourcing-examples" @@ -28,14 +39,6 @@ fi ${DOCKER_COMPOSE?} up -d mongodb $EXTRA_INFRASTRUCTURE_SERVICES -if [ -z "$DOCKER_HOST_IP" ] ; then - if which docker-machine >/dev/null; then - export DOCKER_HOST_IP=$(docker-machine ip default) - else - export DOCKER_HOST_IP=localhost - fi - echo set DOCKER_HOST_IP $DOCKER_HOST_IP -fi if [ -z "$SPRING_DATA_MONGODB_URI" ] ; then export SPRING_DATA_MONGODB_URI=mongodb://${DOCKER_HOST_IP?}/mydb