Changelog library
This library is a wrapper on top of Jenkins changelog plugin. Jenkins changelog plugin needs to be installed before using this library. The library uses mustache template embedded in html for formatting data.
PREREQUISITES
Git Changelog Plugin https://plugins.jenkins.io/git-changelog/
Script usage
First add Jenkins changelog library in your Jenkins shared library.
Now, to generate changelog use the generate method from changelog.groovy script file. new Changelog().generate(steps, options)
Example Usage
import com.amarula.changelog.Changelog
node {
def options = [from: "v1.0", to: "master"]
stage('Example') {
git branch: 'master',
credentialsId: 'github_credential_id',
url: 'https://github.com/example.git'
new Changelog().generate(this, options)
}
}
Parameters
steps Context of current pipeline(this)
options Map containing
from
andto
value. Herefrom
andto
is a tag or ref for which the changelog needs to be generated.