Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-18714

Wrong artifact repo path in BuildInfo when uploading binary identical artifacts

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      When uploading two binary identical artifacts, the buildInfo object will buildInfo will use the repo path of the second artifact for both artifacts.

      This can break build promotions because not all artifacts are copied to their expected location.

      You can use the following Jenkinsfile to reproduce:

      pipeline {
          agent any
          stages {
              stage('Artifactory') {
                  steps {
                      sh 'echo "FOO $BUILD_NUMBER" > BAR'
                      sh 'echo "FOO $BUILD_NUMBER" > BAR2'
                      script{
                          def server = Artifactory.server 'myserver'
                          buildInfo = Artifactory.newBuildInfo()
                          def uploadSpec = """{
                            "files": [
                              {
                                "pattern": "BAR*",
                                "target": "playground/play/"
                              }
                           ]
                          }"""
                          buildInfo = server.upload spec: uploadSpec, buildInfo: buildInfo
                          server.publishBuildInfo buildInfo
                      }
                  }
              }
          }
      }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              eyalb Eyal Ben Moshe
              Reporter:
              martin.ulmschneider Martin Ulmschneider
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: