0

Is there any way to avoid triggering build on certain file commits which are not directly related to source code?

e.g. I don't want to trigger a automatic build when anyone make changes to README.md file or some reference document file.

Kundan
  • 1,394
  • 1
  • 13
  • 26

2 Answers2

1

I don't know that it's described in the plugin page or the Wiki, but at least according to the Advanced Features/Additional Behaviors, the git plugin can be configured to do what you're looking for in multiple ways. eg: Polling ignores commits in certain paths lets you specify an Included region or Excluded region" The help (?) says:

Each exclusion uses java regular expression pattern matching, and must be separated by a new line.

myapp/src/main/web/.*\.html
myapp/src/main/web/.*\.jpeg
myapp/src/main/web/.*\.gif

The example above illustrates that if only html/jpeg/gif files have been committed to the SCM a build will not occur.

You'd have to try them out. One less plugin - KISS!

Git Advanced Features

Ian W
  • 4,559
  • 2
  • 18
  • 37
0

After searching for quite a while I finally found a Jenkins plugin which can skip the build when there is keyword "[ci skip]" in the commit message.

This allows to skip a build on any file commit which has this keyword [ci skip].

only disadvantage is, it will skip the build even if somebody puts [ci skip] in a code file commit

Github: jenkins-ci-skip-plugin

Kundan
  • 1,394
  • 1
  • 13
  • 26