Skip to content
Snippets Groups Projects
Commit 6e6beb02 authored by Mirco Nasuti's avatar Mirco Nasuti
Browse files

captain tests auto-detect docker gateway

parent aa2bbedb
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ fi
docker run --name portal-db -p 5432:5432 -e POSTGRES_USER=postgres -d postgres
echo 'Wating for DB to start...'
echo 'Waiting for DB to start...'
until [ $(docker exec portal-db psql -U postgres -c "\q" 2>&1 | wc -l) -eq 0 ]; do
printf '.'
sleep 1
......@@ -28,7 +28,7 @@ docker run --name portal-backend -p 8080:8080 \
-e "FRONTEND_REDIRECT_URL=http://localhost/home" \
-d hbpmip/portal-backend
echo 'Wating for backend to start...'
echo 'Waiting for backend to start...'
until [ $(docker logs portal-backend | grep "Started MIPApplication" | wc -l) -eq 1 ]; do
printf '.'
sleep 1
......
#!/usr/bin/env bash
export WORKSPACE=$(pwd)
captain test
\ No newline at end of file
......@@ -16,17 +16,20 @@ fi
docker run --name portal-db-test -p 5432:5432 -e POSTGRES_USER=postgres -d postgres
echo 'Wating for DB to start...'
echo 'Waiting for DB to start...'
until [ $(docker exec portal-db-test psql -U postgres -c "\q" 2>&1 | wc -l) -eq 0 ]; do
printf '.'
sleep 1
done
GATEWAY_IP=$(docker inspect portal-db-test | grep \"Gateway\":\ \" | sed 's/.*Gateway\":\ \"\([^-]*\)\",/\1/' | head -n 1)
docker run --name portal-backend-test -p 8080:8080 \
-e "AUTHENTICATION=0" \
-e "DB_URL=jdbc:postgresql://$GATEWAY_IP:5432/postgres" \
-d hbpmip/portal-backend
echo 'Wating for backend to start...'
echo 'Waiting for backend to start...'
until [ $(docker logs portal-backend-test | grep "Started MIPApplication" | wc -l) -eq 1 ]; do
printf '.'
sleep 1
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment