Giter Club home page Giter Club logo

spring-boot-continuous-deploy's Introduction

spring-boot-continuous-deploy

Continuous Deployment with Spring Boot and Jenkins

Requeriments

  • Maven
  • Java
  • Jenkins
  • Git

Structure

__deploy
   __develop
      __clone-project
      server-dev.log
      myproject.jar
   __production
      __clone-project
      server-prod.log
      myproject.jar

Shell script life cycle

First step:

The clone of the branch (master or develop)

Second step:

Performs the maven clean package to generate our application.jar

Third step:

Let's move our jar to directory (develop or production)

Fourth step:

Kill the process that is running the application

Fifth step:

restart our application.

Usage

Replace the {} parameters in the shells files.

Parameters Description
{YOUR_USER} Your linux machine user.
{YOUR_USER_GIT} Your git user for authentication in the pull command.
{YOUR_PASSWORD_GIT} Your git password for authentication in the pull command.
{URL_GIT} Git url of your project.
{JAR_NAME} JAR NAME OF YOUR PROJECT

Jenkins Integration

First step:

create job project maven.

Second Step:

Source Code Management use GIT

Select branch (master or develop)

Third step:

Check the SCM periodically

add schedule ****

Fourth step:

Add Post Steps if build succeeds

Run Shell

./deploy-master or ./deploy-develop

Configuration Enviroment Spring Boot

Add in your application-production.properties

spring.profiles.active=production
logging.level.org.springframework.security: INFO
logging.level.org.springframework.web: INFO
server.port=8082
server.context-path=/
server.tomcat.remote-ip-header=x-forwarded-for
server.tomcat.protocol-header=x-forwarded-proto
server.tomcat.access-log-enabled=true
server.tomcat.basedir=target/tomcat
server.tomcat.uri-encoding=UTF-8

Use application-properties for develop

spring.profiles.active=develop
server.port=8083
logging.level.org.springframework.security: INFO
logging.level.org.springframework.web: INFO

License

The MIT License (MIT)

Copyright (c) 2017 José Vieira 

Permission is hereby granted, free of charge, to any person obtaining a 
copy of this software and associated documentation files (the "Software"), 
to deal in the Software without restriction, including without limitation 
the rights to use, copy, modify, merge, publish, distribute, sublicense, 
and/or sell copies of the Software, and to permit persons to whom the Software is 
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included 
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

spring-boot-continuous-deploy's People

Contributors

netodevel avatar

Watchers

VirtualAdrian avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.