Created
May 1, 2018 00:53
-
-
Save wichopy/bbd26c318f2cd1d75d533aef5317928f to your computer and use it in GitHub Desktop.
Redeploy server war and restart postgres docker container locally.
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
#!/bin/bash | |
echo "Stop tomcat"; | |
/Library/Tomcat/bin/shutdown.sh; | |
echo "Restart postgres container"; | |
#Assuming you have docker, with a postgres container running called local-postgres. The postgres container can be renamed in the docker run command. | |
docker stop local-postgres; | |
docker rm local-postgres; | |
docker run --name local-postgres -e POSTGRES_USER=user -e POSTGRES_DB=db -d -p 5432:5432 postgres; | |
echo "Package server war"; | |
mvn clean package war:war; | |
echo "Deploy to local tomcat"; | |
cp target/server.war /usr/local/tomcat/webapps/server.war; | |
echo "Start tomcat"; | |
/Library/Tomcat/bin/startup.sh; | |
echo "Wait for server to start"; | |
#Assuming you have npm package wait-on globally installed with `npm install -g wait-on` | |
wait-on http://localhost:8080/server/swagger-ui && echo "Done restarting server + postgres container"; # wait for http 2XX HEAD | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment