/pipeline-library

Collection of custom steps and variables for our Jenkins instance(s)

Primary LanguageGroovy

Pipeline Global Library

This repository contains a series of steps and variables for use inside of the Jenkins project’s own Jenkins instance(s).

Useful steps:

buildPlugin

Applies the appropriate defaults for building a Maven-based plugin project on Linux and Windows.

You are advised to be using a 2.x parent POM.

Jenkinsfile
buildPlugin()

Optional arguments

  • jdkVersions (default: [8]) - JDK version numbers, must match a version number jdk tool installed

  • repo (default: null inherit from Multibranch) - custom Git repository to check out

  • failFast (default: true) - instruct Maven tests to fail fast

  • platforms (default: ['linux', 'windows']) - Labels matching platforms to execute the steps against in parallel

  • jenkinsVersions: (default: [null]) - a matrix of Jenkins baseline versions to build/test against in parallel (null means default)

Usage:

Jenkinsfile
buildPlugin(platforms: ['linux'], jdkVersions: [7, 8])

infra.isTrusted()

Determine whether the Pipeline is executing in an internal "trusted" Jenkins environment

Jenkinsfile
if (infra.isTrusted()) {
    /* perform some trusted action like a deployment */
}