Last active
July 17, 2017 03:36
-
-
Save loinguyenduc101/ae246f1e099f049ea5034166047bc6b1 to your computer and use it in GitHub Desktop.
spring-boot-jenkin
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
#http://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html | |
#https://stackoverflow.com/questions/28500066/how-to-deploy-springboot-maven-application-with-jenkins | |
sudo mvn clean package | |
service=appp_pay | |
jarfile=/var/lib/jenkins/workspace/appp_pay/target/appp-pay-0.1.jar | |
if ps ax | grep -v grep | grep -v $0 | grep $service > /dev/null | |
then | |
sudo service appp_pay stop | |
sudo unlink /etc/init.d/appp_pay | |
sudo chmod +x $jarfile | |
sudo ln -s $jarfile /etc/init.d/appp_pay | |
sudo service appp_pay start --spring.profiles.active=prod | |
else | |
sudo chmod +x $jarfile | |
sudo unlink /etc/init.d/appp_pay | |
sudo ln -s $jarfile /etc/init.d/appp_pay | |
sudo service appp_pay start --spring.profiles.active=prod | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment