The context is a JenkinsFile in which I need to use the copyArtifacts
function to catch a specific file among all the artifacts of another build. This function uses ANT-style path pattern
. The build contains several artifacts:
- foo_1.23.456_bar.baz
- foo_1.23.456_qux_bar.baz
- foo_1.23.456_thud.baz
And I only want to catch the first one, without catching another one. The 1.23.456
part is varying and can contain any set of decimal number (it's a version number).
What I tried so far
foo_*([0-9]).*([0-9]).*([0-9])_bar.baz
foo_*\.*\.*\._bar.baz
foo_*\\.*\\.*\\._bar.baz
In all those cases, I either get a Jenkins syntax error, or I don't catch any file at all, or I catch too many of them. I've thoroughly read this QA but this time it didn't help me.
Can someone help me figuring out the correct ANT-style path pattern for this specific usecase ?