We use Travis CI for automating builds, tests and deployment.
Deployment includes publishing a github release and up to date project documentation as a github page.
Deployment on a showcase environment is made after merging a pull request on the main repository (INSEE)
Following steps apply during the integration process:
- Build artifact
- Build frontend application
- Package frontend assets into war file
- Deploy artifact on a docker container
- Run unit tests and integration tests
- Build documentation
Configuration
Configuration is defined in .travis.yml:
language: java
jdk:
- openjdk8
services:
- docker
install:
- bash scripts/install.sh
script:
- mvn test
- bash scripts/build.sh rmspogfo
- docker build -t bwerquin/pogues-bo .
after_success:
- bash scripts/tag.sh
deploy:
- skip_cleanup: true
provider: script
script:
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
&& docker push bwerquin/pogues-bo
on:
branch: master
after_deploy:
- bash scripts/gitbook.sh
branches:
except:
- "/^v[0-9]+\\.[0-9]+\\.[0-9]+.*/"
Building documentation
Documentation is build continuously with travis gitbook and publish on project github page.
Documentation build will occure only on travis job refering to the branch 'zenika-dev' (and not on pull requests).*
Basically, documentation should hence be merged only when a pull request has been merged on the main repository (refer to our workflow overview)
Those steps are described in scripts/gitbook.sh
Publishing on github pages implies a push on branch (branche gh-pages). To make it possible we need to:
- Generate an access token with a granted account
- Give this token the 'repo' autorization scope
Create a GITHUB_TOKEN environment variable on Travis dashboard with our token as a value
Reporting
Each build generate a test coverage report published on coveralls.io
This page can be reached from the coverage badge include in the project README:
Just as for documentation we need to generate a token to grant access to coveralls.io to Travis
Binding this token to the COVERALLS_TOKEN environment variable on Travis we can now generate a report using the followin maven goal:
mvn -DrepoToken=$COVERALLS_TOKEN coveralls:report