How to trigger a Jenkins build in Gerrit Trigger on change to two directories -
i'm using gerrit trigger plugin jenkins trigger job. want trigger job if files folder 1 and folder 2 changed. far understanding concerned, following configuration can trigger job if files folder 1 or folder 2 changed. how can and condition? i'll appreciate help.
click here see gerrit trigger plugin configuration screenshot
as workaround, may fetch changes on job trigger , check if changes done in both dirs.continue when both condition meet. pseudo-code groovy/pipeline:
// changes sh 'git diff-tree --no-commit-id --name-only -r head > changes.txt' //create list changes,each entry def file = readfile "changes.txt" changed_files=file.split('\n') //iterate on changed_files , check if trigger directories present //flag if found //if conditions met,continue build
Comments
Post a Comment