Search code examples
artifactory

How to upload file to Artifactory with matching wildcard


I have a CLI like below

jfrog.exe rt upload ".exe;.dll;*.bpl;" "apex/nightly/v7/v7.8.2/build/" --user=XX --password=XX --url=XX --recursive=false --flat=true

but returns success:0 and failure:0. This used to work when I uploaded *.*, but now I want to match these three patterns.


Solution

  • Below command works while using with single argument of any pattern:

    jfrog.exe rt upload "*.exe" "apex/nightly/v7/v7.8.2/build/" --user=XX --password=XX --url=XX --recursive=false --flat=true
    

    Since you would like to match multiple patterns, we can use the --spec arguments, refer to article jfrog-cli/uploading-files for more detail.

    Below is an example command and the payload sec format

    jfrog.exe rt upload --spec upload-test.spec --user=XX --password=XX --url=XX --recursive=false --flat=true
    

    % cat upload-test.spec

    {
      "files": [
        {
          "pattern": "*.exe",
          "target": "apex/nightly/v7/v7.8.2/build/"
        },
        {
          "pattern": "*.dll",
          "target": "apex/nightly/v7/v7.8.2/build/"
        }
      ]
    }
    

    Also, we can use simple pattern as "pattern": "(*.exe|*.dll)" which works as similar to above payload.