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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Geoffroy J
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

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAG_uJ%2BD7iRNrvFA64Oqh41hWh6EGCu8jwVOT-4SXGBh8nb8_%2Bg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

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

Victor Martinez
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

On Thursday, 12 November 2020 at 09:39:51 UTC [hidden email] wrote:
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

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6030fad1-4c5f-47af-a3ac-1a401978b934n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

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

Geoffroy J
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

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/4a8cc90e-2cc3-453c-9101-c49ad4f4f1cfn%40googlegroups.com.