Skip to content
An SCM filter for multibranch pipelines and GitHub organization pipelines which filters branches by YAML.
Groovy HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Release scm-filter-jervis 0.2 Nov 10, 2019
LICENSE Support for Jenkins credentials, add option, and Nov 7, 2019 Add instructions on how to configure YAML filter Nov 7, 2019 Document testing locally Nov 8, 2019
build.gradle Support searching for multiple YAML files Nov 10, 2019
gradlew Add gradle wrapper Apr 28, 2019
gradlew.bat Add gradle wrapper Apr 28, 2019

SCM Filter Jervis YAML Plugin

This plugin is intended for Jenkins infrastructure relying on jervis to deliver software in a self-service manner.

This plugin can also be used for Travis CI YAML.

How to configure this plugin

  1. Configure a multibranch pipeline job or a GitHub organization job.

  2. Select GitHub Branch Source as the SCM type for the repository.

  3. Under behaviors, click the Add button and select Filter by Jervis YAML for branches, pull requests, and tags.

    Screenshot of add Jervis behavior

  4. Save or customize the YAML file name. You can customize the YAML file name to be something other than .jervis.yml at the root of the repository.

    Screenshot of configuring Jervis behavior

Short Introduction

This will look at the root of a GitHub reference for .jervis.yml for the branches and tags filtering. You can customize the name of the YAML file searched for if you like.

For Tags:

  • It will filter for the tag name.

For Branches:

  • It will filter for the branch name.
  • It will filter for pull requests destined for the branch name.

Example YAML

    - master

More on specify branches and tags to build

By default Jervis will generate Jenkins jobs for all branches that have a .jervis.yml file. You can control and limit this behavior by specifying the branches or tags key in your .jervis.yml.

Whitelist or blacklist branches and tags

You can either whitelist or blacklist branches that you want to be built:

# blacklist
    - legacy
    - experimental

# whitelist
    - master
    - stable

The same YAML can be applied to tags.

# blacklist
    - /.*-rc/
    - /.*-beta/

# whitelist
    - /v[.0-9]+/

If you specify both only and except, then except will be ignored. .jervis.yml needs to be present on all branches you want to be built. .jervis.yml will be interpreted in the context of that branch so if you specify a whitelist in your master branch it will not propagate to other branches.

Using regular expressions

You can use regular expressions to whitelist or blacklist branches:

    - master
    - /^[.0-9]+-hotfix$/

Any name surrounded with / in the list of branches is treated as a regular expression. The expression will use Pattern.compile to compile the regex string into a Groovy regular expression.

You can’t perform that action at this time.