Skip to content

andreAmorimF/jenkins-github-mail-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

jenkins-github-mail-template

A jenkins mail template, based on Groovy, capable of querying GitHub in order to obtain tickets URLs of a given build changelog.

Requirements

This mail template is based on the Email-Ext plugin and uses jenkins Groovy API to obtain information about commits on the Git changelog. Other extremely useful plugin for using along with this template is the Managed Script Plugin, used to make it easy to insert this template into a project Jenkinsfile.

Installation

In order to install this template, use the Managed Script Plugin to insert this template into your Jenkins as a Extended Email Publisher Groovy Template.

Usage

First of all, using the plugin, create a managed file of type Extended Email Publisher Groovy Template with id jenkins-github-changelog. This file must contain the content of the jenkins-github-changelog.groovy script, existing in this repository.

In your Jenkinsfile, in order to obtain the resolved content of the script, reference the managed script such it is indicated on the example bellow:

def content = '${SCRIPT, template="managed:jenkins-github-changelog"}'

emailext (
        to: 'destination@whatever.com',
        from: 'source@whatever.com',
        replyTo: 'source@whatever.com',
        subject: "Git changelog!!!",
        body: content,
        attachLog: false,
        mimeType: 'text/html',
)

Don't forget to change the reference baseUrl variable on the template in order to indicate your GitHub/GitHub Entreprise base url:

<!-- CHANGE ME! -->
def baseUrl="https://github.mycompany.com"

About

A jenkins Groovy managed template, capable of query Github for obtain url of tickets of corresponding changes for a beautiful changelog mail.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages