Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot and Continuous Delivery simple pipeline

I can't find any example or article how can the continuous delivery pipeline look like when we are using Spring Boot + Jenkins.

In Java EE I usually do it like this:

  • Push changes to repository
  • Jenkins checks for changes every 5 minutes
  • if there was a change, Jenkins pulls the sources and run maven build
  • using wildfly maven plugin I run redeploy on server

And generally I wonder what to do in last point when I'm using Spring Boot. Application is packaged into single JAR and run in separate process so in Spring Boot there is actually no such thing like redeploy. Do I have to write some script to kill old process first and then run the new artifact? Or maybe there is something like "spring boot cli" where I could manage all running spring boot apps?

like image 782
swch Avatar asked Dec 02 '16 09:12

swch


1 Answers

You need to kill old process and run new process as a service. It is all very well explained here Spring Boot application as a Service.

There is nice ssh plugin for jenkins that we use : https://wiki.jenkins-ci.org/display/JENKINS/Publish+Over+SSH+Plugin

  1. Copy jar to the server
  2. Stop old service
  3. Run new service

EDIT : Added Spring boot reference for running spring boot as a service - http://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html @Vaelyr

like image 99
SeaBiscuit Avatar answered Oct 08 '22 01:10

SeaBiscuit