Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to trigger a build only if changes happen on particular set of files

How do I tell Jenkins/Hudson to trigger a build only for changes on a particular project in my Git tree?

like image 674
xavier.seignard Avatar asked Mar 09 '11 09:03

xavier.seignard


People also ask

How do you trigger a build in Jenkins?

Create a remote Jenkins build trigger in three stepsCreate a Jenkins build job and enable the Trigger builds remotely checkbox. Provide an authentication token; This can be any text string of your choice. Invoke the Jenkins build URL to remotely trigger the build job.

Can you list few ways by which we can trigger a build in Jenkins?

Trigger builds remotely. Build after other projects are built. Build periodically. GitHub hook trigger for GITScm polling.

What is used to track the changes between builds in Jenkins?

The simplest way to know what has changed on your Jenkins builds! Last Changes is a Jenkin plugin that shows rich VCS diffs between builds. Only Git and Svn based projects are supported.


1 Answers

The Git plugin has an option (excluded region) to use regexes to determine whether to skip building based on whether files in the commit match the excluded region regex.

Unfortunately, the stock Git plugin does not have a "included region" feature at this time (1.15). However, someone posted patches on GitHub that work on Jenkins and Hudson that implement the feature you want.

It is a little work to build, but it works as advertised and has been extremely useful since one of my Git trees has multiple independent projects.

https://github.com/jenkinsci/git-plugin/pull/49

Update: The Git plugin (1.16) now has the 'included' region feature.

like image 93
Aaron Kushner Avatar answered Sep 18 '22 08:09

Aaron Kushner