How to conditionally execute a step based on changeset (multiple paths)?

17 views
Skip to first unread message

Geoffroy J

unread,
Nov 12, 2020, 4:39:51 AM11/12/20
to jenkins...@googlegroups.com
Hello

our repository structure is as follow (simplified):
/app 
    |-- /linux
    |-- /win
    |-- /macos

i am trying to execute conditionally a build step based on changeset content into both linux & macos folder, but it is not working properly:

when { changeset "*/linux/**,*/macos/**" }

Is it possible to define multiple paths in a changeset using above syntax? Or do i need to use regex, something like when { changeset " .*\/(linux|macos)\/.*", comparator: "REGEXP" }  ?

Thanks in advance
Regards

Victor Martinez

unread,
Nov 12, 2020, 5:51:33 AM11/12/20
to Jenkins Users
Hi,

The comma is not supported since it does a GLOB match by default. You can use multiple changeset entries in the when or the regexp approach should be another way

Cheers

geoffroy...@gmail.com

unread,
Nov 13, 2020, 2:42:11 PM11/13/20
to Jenkins Users
Thanks for the hint, seems multiple changeset entries solution is simple enough in our case.
I would go for regex for a more complex use case
Regard

Reply all
Reply to author
Forward
0 new messages