We have a Subversion repository setup in this manor:
http://svn.vegicorp.net/svn/toast/api/trunk
http://svn.vegicorp.net/svn/toast/api/1.0
http://svn.vegicorp.net/svn/toast/data/trunk
http://svn.vegicorp.net/svn/toast/data/branches/1.2
http://svn.vegicorp.net/svn/toast/data/branches/1.3
I've setup a Jenkins Multi-Pipeline build for the entire toast project including all sub-projects -- each sub-project is a jarfile. What I want is for Jenkins to fire off a new build each time any file is changed in one of the toast projects. That project should rebuild. This way, if we create a new sub-project in toast or a new branch in one of the toast sub-projects, Jenkins will automatically create a new build for that.
Here's my Jenkins Multi-Branch setup:
Branch Sources
Subversion
- Project Repository Base:
http://svn.vegicorp.net/svn/toast
- Credentials:
builder/*****
- Include Branches:
*/trunk, */branches/*
- Exclude Branches:
*/private
- Property Strategy: All branches get the same properties
Build Configuration
- Mode: By Jenkinsfile
Build Triggers (None selected)
- Trigger builds remotely (e.g., from scripts) Help for feature: Trigger * builds remotely (e.g., from scripts)
- Build periodically Help for feature: Build periodically
- Build when another project is promoted
- Maven Dependency Update Trigger Help for feature: Maven Dependency Update Trigger
- Periodically if not otherwise run
Note that the list of Build Triggers list does not include Poll SCM. Changes in the repository does not trigger any build. Jenkinsfiles
are located at the root of each sub-project. If I force a reindex, all changed sub-projects get built and all new branches are found. I did originally checked Periodically and reindexed every minute to pick up a change, but that's klutzy and it seems to cause Jenkins to consume memory.
Triggering a build on an SCM change should be pretty basic, but I don't see a configuration parameter for this like I do with standard jobs. I also can't seem to go into sub-projects and set those to trigger builds either.
There must be something really, really simple that I am missing.
Configuration:
- Jenkins 2.19
- Pipeline 2.3
- Pipeline API: 2.3
- Pipeline Groovy: 2.17
- Pipeline Job: 2.6
- Pipeline REST API Plugin: 2.0
- Pipeline Shared Groovy Libraries: 2.3
- Pipeline: Stage View Plugin: 1.7
- Pipeline: Supporting APIs 2.2
- SCM API Plugin: 1.2