Skip to content

Instantly share code, notes, and snippets.

@danielpetisme
Created September 24, 2018 11:32
Show Gist options
  • Save danielpetisme/babf809ae0e7cb3aa8a500b6d8ef1c40 to your computer and use it in GitHub Desktop.
Save danielpetisme/babf809ae0e7cb3aa8a500b6d8ef1c40 to your computer and use it in GitHub Desktop.
JHipster jib Integrqtion
#-------------------------------------------------------------------------------
# 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