Automated Change Log Creation during Build

If you build your Spring Boot app with Jenkins Pipeline from a Git repository you can easily add a step to create a changelog.txt during build.

{
  stage('Generate changelog.txt') {
    sh 'mkdir -p ./src/main/resources/static'
    sh 'git log --pretty=oneline --abbrev-commit > ./src/main/resources/static/changelog.txt'
  }
}

This will generate a git-log with a bit of Commit Formatting.

The git log is stored in the file changelog.txt inside src/main/resources/static folder.

Per default the Spring Boot app will serve files inside a static folder. For more information @see the official docs: Static Content.

The packaged app will serve the change log via localhost:8080/changelog.txt.

With this small change you will always know the current state of your deployment.