3

I've previously had SVN as our source control and when using the polling ignore if certain paths, I've been able to set them in the Jenkins config using regex paths like "/project/buildscripts/.*"

Now that we're using git, I have one repo full of infrastructure projects, which looks like this:

[root] /project.1 /project.2 /project.3 allprojects.sln

I want to build only the csproj within project.1 directory when a push is made into that directory by ignoring polling on /project.2 and /project.3

because there's a period in the pathing I'm trying to ignore, I'm having issues solving the proper syntax

For the section of Git labeled "Polling ignores commits in certain paths" I've tried:

Project.2/.* (which won't ignore ANY directory pushed to...) /Project.2/.* (Which ignores pushes to ALL directories) /Project.2/.* (Which ignores pushes to ALL directorys)...

I need help resolving the syntax accepted for the Included Regions of "Polling ignores commits in certain paths". does anyone know the required syntax to ignore commits in git?

Kevinsyel
  • 143
  • 1
  • 9

1 Answers1

4

I figured it out, but I still have yet to find where this is exactly documented. While SVN has simply one text fill to exclude commit paths, Git has two.

The "Included Regions" section of the Polling module is NOT "including regions you want to ignore", but for including regions you wish to poll from.

the proper place to put directories to hide from polling is the "Excluded Regions"

Also, the syntax is not like the SVN syntax. If My project were to sparse my checkout to only pull "Project.1" then to ignore polling of my other directories in git, I must write them as such in the "Excluded Region":

Project.2/.* Project.3/.*

I hope this helps anyone else confused by the text like I was.

Kevinsyel
  • 143
  • 1
  • 9
  • The wording in Jenkins UI is confusing . I too thought the include paths where the ones to include in the exclusion. But, you are right the first paths are paths to include; causing the exclusion of all other paths. The second set of paths are ones to specifically exclude. ... The help button in the config page points to https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html, but I find that useless techno-babble. I don't want a 10 page spec (TL;DR), I want like 5 examples. – steve May 06 '21 at 11:18
  • According to https://medium.com/@abhijeetahuja/jenkins-polling-ignores-commits-in-certain-paths-aeb2927b0e7a, to ignore a directory you do like: rubbish-dir/.* ... what weird syntax. Why the dot? – steve May 06 '21 at 11:20