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

Artifactory plugin 2.11 worked but 2.12 broke updating job location

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • artifactory-plugin
    • None
    • Jenkins v.2.68
      os.version - 3.10.0-514.16.1.el7.x86_64

      The patterns used in the job: aspen-local/puppet/.zip

      The target: /{1}.zip

      Rollback to 2.11 fixed the issue

          [JENKINS-45341] Artifactory plugin 2.11 worked but 2.12 broke updating job location

          Can you please share with us a full File Spec that worked for you in version 2.11, and stopped working in 2.12?

          Eyal Ben Moshe added a comment - Can you please share with us a full File Spec that worked for you in version 2.11, and stopped working in 2.12?

          Arkadiy Rudin added a comment -

          {

              "files": [

                  {

                      "pattern": "$pattern",

                      "target": "$target"

                  }

              ]

          }

          Arkadiy Rudin added a comment - {     "files": [         {             "pattern": "$pattern",             "target": "$target"         }     ] }

          Actually I was hoping you can share with us a File Spec we can work with

          Something that we can run with 2.11 - see that it works and then run it with 2.12 and see the failure.

          We can then debug the code and figure out the issue. The Spec you shared include two variables, for which we don't have the value. The original pattern value you put in the issue description includes an unreadable character. 

          Eyal Ben Moshe added a comment - Actually I was hoping you can share with us a File Spec we can work with Something that we can run with 2.11 - see that it works and then run it with 2.12 and see the failure. We can then debug the code and figure out the issue. The Spec you shared include two variables, for which we don't have the value. The original pattern value you put in the issue description includes an unreadable character. 

          Chris Denneen added a comment -

          eyalbe so a repo with aspen-local/puppet/code.zip and target /{1}.zip would render as follows right?

           

          {

              "files": [

                  {

                      "pattern": "aspen-local/puppet/*.zip",

                      "target": "/{1}.zip"

                  }

              ]

          }

          Chris Denneen added a comment - eyalbe so a repo with aspen-local/puppet/code.zip and target /{1}.zip would render as follows right?   {     "files": [         {             "pattern": "aspen-local/puppet/*.zip",             "target": "/{1}.zip"         }     ] }

          Gerd Zanker added a comment -

          Here a different example which did not work for me with 2.12.2 anymore, but 2.11 is fine.

          FileSpec in Jenkinsfile

          def uploadSpec = """{
              "files": [
                      { "pattern": "bin/doc/(*)",			"target": "${artifactoryTarget}/doc/{1}", "flat": "false" },
                  ]
              }"""
          server.upload spec: uploadSpec

          Output

          [Pipeline] artifactoryUpload
          For pattern: bin/doc/(*) 5020 artifacts were found.
          Deploying artifact: http://<server>:<port>/artifactory/<repo>/<folder>/doc/{1}
          [Pipeline] publishBuildInfo

          In Artifactory I only see a single file named {1} and not the expected 5020 HTML documentation files

          Gerd Zanker added a comment - Here a different example which did not work for me with 2.12.2 anymore, but 2.11 is fine. FileSpec in Jenkinsfile def uploadSpec = """{ "files" : [ { "pattern" : "bin/doc/(*)" , "target" : "${artifactoryTarget}/doc/{1}" , "flat" : " false " }, ] }""" server.upload spec: uploadSpec Output [Pipeline] artifactoryUpload For pattern: bin/doc/(*) 5020 artifacts were found. Deploying artifact: http: //<server>:<port>/artifactory/<repo>/<folder>/doc/{1} [Pipeline] publishBuildInfo In Artifactory I only see a single file named { 1 } and not the expected 5020 HTML documentation files

          gerd_zanker,

          I've just tried this with version 2.12.2 and it seems to be working for me as expected.

          Could it be that there's something in your specific File Specs that causes this? Can you try and copy my File Spec and try running it? Here's what I tried:

          node {
          def server = Artifactory.server "SERVER_ID"
          
          def uploadSpec = """{
              "files": [{ 
                  "pattern": "gradle-examples/*/(*.gradle)",
                  "target": "tests/doc/aaa----{1}", 
                  "flat": "false" 
              }]
          }"""
          server.upload spec: uploadSpec
          }

          and here's the build log. As you can see, the {1} placeholder is replaced in the uploaded file name.

          Started by user admin
          [Pipeline] node
          Running on master in /Users/eyalb/.jenkins/workspace/pipe-2
          [Pipeline] {
          [Pipeline] getArtifactoryServer
          [Pipeline] artifactoryUpload
          For pattern: gradle-examples/*/(*.gradle) 55 artifacts were found.
          Deploying artifact: http://localhost:8081/artifactory/tests/doc/aaa----build.gradle
          Deploying artifact: http://localhost:8081/artifactory/tests/doc/aaa----init.gradle
          Deploying artifact: http://localhost:8081/artifactory/tests/doc/aaa----settings.gradle
          [Pipeline] }
          [Pipeline] // node
          [Pipeline] End of Pipeline
          Finished: SUCCESS

          If you can share a sample JenkinsFile through github that reproduces this, we can run it and see the output.

           

          Eyal Ben Moshe added a comment - gerd_zanker , I've just tried this with version 2.12.2 and it seems to be working for me as expected. Could it be that there's something in your specific File Specs that causes this? Can you try and copy my File Spec and try running it? Here's what I tried: node { def server = Artifactory.server "SERVER_ID" def uploadSpec = """{ "files" : [{ "pattern" : "gradle-examples/*/(*.gradle)" , "target" : "tests/doc/aaa----{1}" , "flat" : " false " }] }""" server.upload spec: uploadSpec } and here's the build log. As you can see, the {1} placeholder is replaced in the uploaded file name. Started by user admin [Pipeline] node Running on master in /Users/eyalb/.jenkins/workspace/pipe-2 [Pipeline] { [Pipeline] getArtifactoryServer [Pipeline] artifactoryUpload For pattern: gradle-examples/*/(*.gradle) 55 artifacts were found. Deploying artifact: http: //localhost:8081/artifactory/tests/doc/aaa----build.gradle Deploying artifact: http: //localhost:8081/artifactory/tests/doc/aaa----init.gradle Deploying artifact: http: //localhost:8081/artifactory/tests/doc/aaa----settings.gradle [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline Finished: SUCCESS If you can share a sample JenkinsFile through github that reproduces this, we can run it and see the output.  

            eyalbe Eyal Ben Moshe
            arkrud85 Arkadiy Rudin
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: