Jenkins

jenkins.io

We build our Jenkins from a docker container, setting up that with code requires setting up the plugin from groovy. I didn't want to figure out how to translate our config for the plain mailer plugin to the email-ext plugin. I started using the plain mailer plugin but decided I'd like to send the email in HTML format. Once again, Jenkins docs were terrible, but reading the code, it looked like mimetype was supported.

I came up with the following code to send an HTML email from the Jenkinsfile


mail to: env.REQUESTOR,
subject: "Pipeline…



I needed to checkout some code from another repository into my project, but I only wanted a specific directory within the other repository.

As usual with Jenkins, the docs are lacking, but reading the source for a bit I came up with the following:


dir('otherrepo') {
checkout([$class: 'GitSCM',
branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: false,
extensions: [
[
$class: 'SparseCheckoutPaths',
sparseCheckoutPaths…