how to ignore jenkisnfile from polling for pipeline jobs

15 views
Skip to first unread message

SADHAN

unread,
Aug 30, 2019, 2:54:00 PM8/30/19
to Jenkins Users
Currently i use Jenkins dsl pipelines for my jobs.
This is the current format:

bitbucket projects:

application projects-> application repos -> source code
devops projects->cicd repo ->jenkinsfile and property file.

jobs: dev,qa,uat,stage,prod

All the above jobs are pipeline jobs, they checkout Jenkinsfile from CICD Repository and does the tasks.
For all environments we have single jenkinsfile.

for dev job, we have to add scm poll of 15 mins so that the job gets triggered if the source code changes.

the problem i am seeing is if i add polling for the source code repo using checkout function of jenkinsfile, the job is getting triggered for the source code changes and also for the jenkisnfiles changes though both are in different Repos.
How do we avoid the polling for jenkisnfiles.

I tried to add "ignore from user" but it dint work, i tried to add "ignore from paths" it also dint work.

Ramanathan Muthaiah

unread,
Sep 1, 2019, 11:58:39 PM9/1/19
to Jenkins Users
On Saturday, August 31, 2019 at 12:24:00 AM UTC+5:30, SADHAN wrote:
the problem i am seeing is if i add polling for the source code repo using checkout function of jenkinsfile, the job is getting triggered for the source code changes and also for the jenkisnfiles changes though both are in different Repos.
How do we avoid the polling for jenkisnfiles.

I tried to add "ignore from user" but it dint work, i tried to add "ignore from paths" it also dint work.

Sharing a tidbit of what I did earlier to avoid triggering fresh builds jobs for changes in Jenkinsfile -- you may need additional logic to process the changeset, i.e. checkout the repo, gather the list of changed files ( this will help to determine if the changeset includes only Jenkinsfile), and then take the necessary action.

/Ram

SADHAN

unread,
Sep 9, 2019, 11:24:57 AM9/9/19
to Jenkins Users

1)I want this check to happen before getting triggered itself else the job always shows failed state incase if jenkinsfiles are changed frequently (note: we have jenkinsfiles in separate repo than source code)
2)In case am ok with above thing also, there will be chances that at the same time, there could be changes in jenkinsfile and also source code. Because we have jenkinsfiles in separate repos than the source code. In that case, the job will be failed saying that teh change is in jenkinsfile
Reply all
Reply to author
Forward
0 new messages