DeZot
DeZot

Reputation: 373

download files from artifactory from a subpath of the specified pattern

I'm trying to have my Jenkins job download some files from Artifactory:

a/b/c
      d1
        file1
      d2
        file2

This is what I want to achieve:

x/y/z
      d1
        file1
      d2
        file2

and I have the following file spec:

{
  "files": [{
      "pattern": "a/b/c/*",
      "target": "x/y/z/",
      "flat": "false",
      "recursive": "true",
    }]
}

but what I end up with instead is

x/y/z/a/b/c
            d1
              file1
            d2
              file2

What am I doing wrong?

Upvotes: 0

Views: 2176

Answers (1)

Dror Bereznitsky
Dror Bereznitsky

Reputation: 20376

You should use the following pattern

{
  "files": [
     {
      "pattern": "a/b/c/(*)",
      "target": "x/y/z/{1}",
      "flat": "true",
      "recursive": "true",
      "regexp": "true"
    }
    ]
}

By setting flat to true artifacts are downloaded to the exact target path specified and their hierarchy in the source repository is ignored.

Upvotes: 3

Related Questions