Skip to content

matjawor/travisCISpringBootExample

Repository files navigation

travisCISpringBootExample

application

junit tests

  • run by gradle task test

junit reports

  • created by gradle task test

jacoco reports

  • created by gradle task jacocoTestReport within plugin jacoco on the basis of results of junit tests with providing of code coverage metrics

coveralls

  • jacoco reports are deployed to coveralls.io
  • coveralls provides test coverage history and statistics of a project
  • current coverage Coverage Status

modules (subprojects) in main project

  • modules1 with its own build.gradle

gradle

  • plugin application with property mainClass to run main method within module1 context by ./gradlew :subprojectName:run
  • junit test plugin for root build.gradle
  • coveralls plugin as above
  • jacoco plugin as above
  • customized task getSubprojectVersion in root context with subprojectName properties as gradlew command parameter ./gradlew getSuprojectVersion -PsubprojectName=name
  • customized task getProjectVersion within subproject context by ./gradlew :module1:getProjectVersion

travis ci

  • pipeline is triggered by push events or pull requests to main branch

travis ci config

include stages

  • on default clone main branch
  • run gradle tests on the project
  • run the application on spring dev profile (application-dev.properties) and close it gracefully
  • send always notification to slack channel with default template

travis cli

  • strongly recommended to encrypt secrets e.g. via travis cli tool that appends changed properties to .travis.yml

docker

  • docker build image based on dockerfile in ci/docker/dockerfile
  • image tag myapp:snapshot
  • docker run with publishing port 8080 to the container's host // todo
  • push docker image to aws ecr

aws s3 with artifacts

  • s3 bucket including archived artifacts i.e. application jar
  • dedicated aws user with essential permissions (aws IAM service) to s3 resource to handle travis ci deployment process
  • s3 deploy section in .travis.yml configuration

heroku deployment

//TODO

  • based on spring prod profile (application-prod.properties)

About

Travis CI with official sprint boot app example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages