Example of Continuous Integration using Travis and Spring Boot.
This example is a simulation of a Task Manager.
You need to have installed Java and Maven
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.
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.
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.
$ mvn spring-boot:run
$ mvn spring-boot:run -Dspring.profiles.active=prod
$ mvn clean package
$ docker build -t mytask .
$ docker run -it -p 8080:8080 --name mytask-container mytask
$ mvn clean package docker:build --batch-mode release:update-versions
$ docker run -it -p 8080:8080 --name mytask-container mytask
MIT