Skip to content

Commit

Permalink
Improve script bin/integration-tests.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Maurizio Turatti committed May 11, 2018
1 parent b1e5a6e commit f6c6cbc
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions bin/integration-tests.sh
@@ -1,13 +1,20 @@
#!/bin/bash
# if you want to run integration tests against a different version of MongoDB
# export the MONGO_VERSION variable.
# For example: export MONGO_VERSION=3.4 && ./bin/integration-tests.sh
if [[ -z $MONGO_VERSION ]]; then
MONGO_VERSION=3.6
fi

cd "$(dirname ${BASH_SOURCE[0]})"/.. || exit 1

echo "### Starting mongodb container..."
docker run --rm --name it-mongo -d -p 27017:27017 mongo:3.6
echo "### Running volatile mongo:$MONGO_VERSION Docker container..."
CONTAINER_ID=$( docker run --rm -d -p 27017:27017 mongo:"$MONGO_VERSION" )

echo "### Build RESTHeart and run integration tests..."
mvn clean verify -DskipITs=false

echo "### Cleaning up..."
docker stop it-mongo
echo "### Cleaning up mongo:$MONGO_VERSION container..."
docker stop "$CONTAINER_ID"

echo "### Done."

0 comments on commit f6c6cbc

Please sign in to comment.