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

add comments and add more test data as needed by the tablesample psql function

parent 879f74c3
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# Kill old containers # Kill old containers
echo "Killing old containers..."
if [ $(docker ps | grep backend-test | wc -l) -gt 0 ]; then if [ $(docker ps | grep backend-test | wc -l) -gt 0 ]; then
docker kill backend-test docker kill backend-test
fi fi
...@@ -16,6 +17,7 @@ fi ...@@ -16,6 +17,7 @@ fi
# Remove old containers # Remove old containers
echo "Removing old containers..."
if [ $(docker ps -a | grep backend-test | wc -l) -gt 0 ]; then if [ $(docker ps -a | grep backend-test | wc -l) -gt 0 ]; then
docker rm -f backend-test docker rm -f backend-test
fi fi
...@@ -29,12 +31,14 @@ fi ...@@ -29,12 +31,14 @@ fi
# Run databases containers # Run databases containers
echo "Running databases containers..."
docker run --name science-db-test -p 65432:5432 -v $(pwd)/tests/science-db/sql:/docker-entrypoint-initdb.d/ -e POSTGRES_USER=science -d postgres:9.5.3 docker run --name science-db-test -p 65432:5432 -v $(pwd)/tests/science-db/sql:/docker-entrypoint-initdb.d/ -e POSTGRES_USER=science -d postgres:9.5.3
docker run --name portal-db-test -p 65433:5432 -v $(pwd)/tests/meta-db/sql:/docker-entrypoint-initdb.d/ -e POSTGRES_USER=portal -d postgres:9.5.3 docker run --name portal-db-test -p 65433:5432 -v $(pwd)/tests/meta-db/sql:/docker-entrypoint-initdb.d/ -e POSTGRES_USER=portal -d postgres:9.5.3
# Get gateway IP # Get gateway IP
echo "Searching gateway IP..."
GATEWAY_IP=$(docker inspect science-db-test | grep \"Gateway\":\ \" | sed 's/.*Gateway\":\ \"\([^-]*\)\",/\1/' | head -n 1) GATEWAY_IP=$(docker inspect science-db-test | grep \"Gateway\":\ \" | sed 's/.*Gateway\":\ \"\([^-]*\)\",/\1/' | head -n 1)
echo "Gateway IP: $GATEWAY_IP" echo "Gateway IP: $GATEWAY_IP"
...@@ -58,6 +62,7 @@ echo "" ...@@ -58,6 +62,7 @@ echo ""
# Run backend container # Run backend container
echo "Running backend container..."
docker run --name backend-test -p 65434:8080 \ docker run --name backend-test -p 65434:8080 \
-e "PORTAL_DB_URL=jdbc:postgresql://$GATEWAY_IP:65433/portal" \ -e "PORTAL_DB_URL=jdbc:postgresql://$GATEWAY_IP:65433/portal" \
-e "PORTAL_DB_SERVER=$GATEWAY_IP:65433/portal" \ -e "PORTAL_DB_SERVER=$GATEWAY_IP:65433/portal" \
...@@ -80,3 +85,6 @@ until [ $(docker logs backend-test | grep "Started MIPApplication" | wc -l) -eq ...@@ -80,3 +85,6 @@ until [ $(docker logs backend-test | grep "Started MIPApplication" | wc -l) -eq
printf '.' printf '.'
sleep 1 sleep 1
done done
echo "DONE"
\ No newline at end of file
This diff is collapsed.
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