Skip to content

Instantly share code, notes, and snippets.

@loinguyenduc101
Last active July 17, 2017 03:36
Show Gist options
  • Save loinguyenduc101/ae246f1e099f049ea5034166047bc6b1 to your computer and use it in GitHub Desktop.
Save loinguyenduc101/ae246f1e099f049ea5034166047bc6b1 to your computer and use it in GitHub Desktop.
spring-boot-jenkin
#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