Add postgres host to running container

This commit is contained in:
Devon Mackay 2018-07-31 06:37:26 -04:00 committed by dandds
parent 40359e8e2d
commit 8f22921622
2 changed files with 7 additions and 2 deletions

View File

@ -21,12 +21,12 @@ before_install:
before_script:
- docker run -d --name postgres96 postgres:9.6-alpine
- docker run --link postgres96:postgres96 waisbrot/wait
- postgres_ip="$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" postgres96)"
- export postgres_ip="$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" postgres96)"
- docker login -u $ATAT_DOCKER_REGISTRY_USERNAME -p $ATAT_DOCKER_REGISTRY_PASSWORD $ATAT_DOCKER_REGISTRY_URL
- docker build --tag "${TESTER_IMAGE_NAME}" --add-host "postgreshost:${postgres_ip}" . -f deploy/docker/tester/Dockerfile
script:
- docker run "${TESTER_IMAGE_NAME}"
- docker run --add-host "postgreshost:${postgres_ip}" "${TESTER_IMAGE_NAME}"
before_deploy:
- docker build --tag "${PROD_IMAGE_NAME}" . -f deploy/docker/prod/Dockerfile

View File

@ -4,5 +4,10 @@
source "$(dirname "${0}")"/../script/include/global_header.inc.sh
echo
echo "DEBUG: Hosts file:"
cat /etc/hosts
echo
# Run lint/style checks and unit tests
source ./script/test