Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve script bin/integration-tests.sh
- Loading branch information
Maurizio Turatti
committed
May 11, 2018
1 parent
b1e5a6e
commit f6c6cbc
Showing
1 changed file
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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." |