Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-42255

uploadSpec directory structure behaviour change

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • artifactory-plugin
    • None
    • Jenkins v2.42 and v2.47

      Artifactory plugin
      - old version: v2.7.2
      - new version: v2.9.1

      Working with MultiBranch Pipelines under Jenkins 2.42 and 2.47, Artifactory Plugin version 2.7.2 and the uploadSpec below, the resulting path on Artifactory is repo-name/subdir1/subdir2/subdir3/build-output/my-file.binary.

      def uploadSpec = """{
        "files": [
          {
           "regexp": "false",
           "flat": "false",
           "pattern": "build-output/*",
           "target": "repo-name/subdir1/subdir2/subdir3/",
          }
        ]
      }"""
      

      After upgrading the Artifactory plugin to the latest version (2.9.1), the resulting path on Artifactory changed and is now repo-name/subdir1/subdir2/subdir3/my-file.binary. It looks like the build-output directory is no longer taken into consideration, which breaks the upload pattern for us.

          [JENKINS-42255] uploadSpec directory structure behaviour change

          Thanks for reporting this issue. We're looking into it now.

          Eyal Ben Moshe added a comment - Thanks for reporting this issue. We're looking into it now.

          We're currently working on a fix. The following issue tracks this task:
          https://www.jfrog.com/jira/browse/HAP-892
          Thanks again for reporting this issue and my apologies for the inconvenience.

          Eyal Ben Moshe added a comment - We're currently working on a fix. The following issue tracks this task: https://www.jfrog.com/jira/browse/HAP-892 Thanks again for reporting this issue and my apologies for the inconvenience.

          Razvan Botez added a comment -

          I installed the latest 2.9.2 plugin and it seems to have fixed this issue. Thanks.

          Razvan Botez added a comment - I installed the latest 2.9.2 plugin and it seems to have fixed this issue. Thanks.

          Itai Sanders added a comment -

          actually we are at 2.10.4 and having the same problem.

          the upload step seems to ignore the "flat"=false flag (download step works fine with flat). it broke a few of our pipelines ever since upgraded.

          Itai Sanders added a comment - actually we are at 2.10.4 and having the same problem. the upload step seems to ignore the "flat"=false flag (download step works fine with flat). it broke a few of our pipelines ever since upgraded.

          Dima Nevelev added a comment -

          itaisanders We found a scenario in which this can happen, when the upload target contains only the repository (for example "pattern": "generic-repo/") the flag is ignored. Can you please confirm that this is your case?
          If so, you can use the spec below as workaround:

          {
          "files": [ 
            {
               "pattern": "(source/*)",
               "target": "tests/{1}",
               "flat": "true"
            }
           ]
          }
          

          If this is not the case please provide us more details about your spec and environment.

          Dima Nevelev added a comment - itaisanders We found a scenario in which this can happen, when the upload target contains only the repository (for example "pattern": "generic-repo/") the flag is ignored. Can you please confirm that this is your case? If so, you can use the spec below as workaround: { "files" : [ { "pattern" : "(source/*)" , "target" : "tests/{1}" , "flat" : " true " } ] } If this is not the case please provide us more details about your spec and environment.

          Itai Sanders added a comment - - edited

          Yes! This is exactly the scenario. I didn't even think about it as a use case.

          Your workaround works, and also going one level into the folder structure and providing it to the base target. so I ended up uploading from inside the "source" folder (taking your example) and using the following spec:

          {
             "files": [
                {
                   "pattern": "*",
                   "target": "tests/source/",
                   "flat": false
                }
             ]
          }
          

          it also seems to do the job, which proves this is indeed the case.

          thanks!

           

          Itai Sanders added a comment - - edited Yes! This is exactly the scenario. I didn't even think about it as a use case. Your workaround works, and also going one level into the folder structure and providing it to the base target. so I ended up uploading from inside the "source" folder (taking your example) and using the following spec: {     "files" : [       {           "pattern" : "*" ,           "target" : "tests/source/" ,           "flat" : false       }    ] } it also seems to do the job, which proves this is indeed the case. thanks!  

            eyalbe Eyal Ben Moshe
            razvan_botez Razvan Botez
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: