Created
September 24, 2018 11:32
-
-
Save danielpetisme/babf809ae0e7cb3aa8a500b6d8ef1c40 to your computer and use it in GitHub Desktop.
JHipster jib Integrqtion
This file contains hidden or 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
#------------------------------------------------------------------------------- | |
# Run Docker | |
#------------------------------------------------------------------------------- | |
if [ "$RUN_APP" == 1 ]; then | |
if [[ "$PROFILE" == "prod" ]]; then | |
cd "$APP_FOLDER" | |
if [ -f "mvnw" ]; then | |
./mvnw -DskipTests package jib:dockerBuild -P"$PROFILE" | |
elif [ -f "gradlew" ]; then | |
./gradlew bootWar jibDockerBuild -P"$PROFILE" -x test | |
else | |
echo "No mvnw or gradlew" | |
exit 0 | |
fi | |
if [ $? -ne 0 ]; then | |
echo "Error when building Docker image" | |
exit 1 | |
fi | |
cd "$APP_FOLDER" | |
docker-compose -f src/main/docker/app.yml up -d | |
sleep 40 | |
launchCurlOrProtractor | |
result=$? | |
docker-compose -f src/main/docker/app.yml stop | |
docker-compose -f src/main/docker/app.yml rm -f | |
docker rmi -f $(docker images -q) | |
exit $result | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment