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
Configure a multibranch pipeline job or a GitHub organization job.
Select GitHub Branch Source as the SCM type for the repository.
Under behaviors, click the
Addbutton and select
Filter by Jervis YAML for branches, pull requests, and tags.
Save or customize the YAML file name. You can customize the YAML file name to be something other than
.jervis.ymlat the root of the repository.
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.
- It will filter for the tag name.
- It will filter for the branch name.
- It will filter for pull requests destined for the branch name.
branches: only: - 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
tags key in your
Whitelist or blacklist branches and tags
You can either whitelist or blacklist branches that you want to be built:
# blacklist branches: except: - legacy - experimental # whitelist branches: only: - master - stable
The same YAML can be applied to tags.
# blacklist tags: except: - /.*-rc/ - /.*-beta/ # whitelist tags: only: - /v[.0-9]+/
If you specify both
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:
branches: only: - master - /^[.0-9]+-hotfix$/