Example of Continuous Integration with Travis, Heroku and Spring Boot
Java HTML JavaScript CSS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src Dockerfile Dec 31, 2016
.gitignore Build image with maven Apr 9, 2017
.travis.yml fix ci Jun 16, 2016
Dockerfile Build image with maven Apr 9, 2017
LICENSE init Jun 16, 2016
Procfile init Jun 16, 2016
README.md Update README.md Apr 9, 2017
pom.xml Build image with maven Apr 9, 2017

README.md

Build Status

ci-spring-boot

Example of Continuous Integration using Travis and Spring Boot.

This example is a simulation of a Task Manager.

Technologies

Configuration

You need to have installed Java and Maven

Spring Boot

For the development profile you do not need to configure anything. In this profile you will use a h2 database.

If you want to use a production profile, you need to change the database configurations into application-prod.properties. In my example I use a environment variable ${DATABASE_URL} to configure the database url.

Heroku

Create an account and then create a new app.

Into your new app add a Add-ons Postgresql database. By default, the environment variable DATABASE_URL will be created.

Travis CI

Create an account and put your repository to be observed by travis.

In your new listener, you need to configure the environment variable $HEROKU_API_KEY or put directly into a .travis.yml (it's not secure).

You need to change the deploy>app into .travis.yml to the same name of heroku app.

Run

Dev Profile
$ mvn spring-boot:run 
Production Profile
$ mvn spring-boot:run -Dspring.profiles.active=prod

Run with Docker Command Line

$ mvn clean package  
$ docker build -t mytask .  
$ docker run -it -p 8080:8080 --name mytask-container mytask

Run with docker-maven-plugin

$  mvn clean package docker:build --batch-mode release:update-versions  
$ docker run -it -p 8080:8080 --name mytask-container mytask

License

MIT