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

withCredentials + file does not work with the same credentialsId across stages

    Details

    • Similar Issues:

      Description

      when using multiple blocks such as:

       

      withCredentials([file(credentialsId: 'KEYFILE', variable: 'KEYFILE')]) {
        sh 'ls -lh ${KEYFILE}'
      }

       

      across multiple stages within the same Jenkinsfile/pipeline - it will only work the first time. After the first credentials-binding block, the keyfile gets deleted but not re-created.

       

      Expectations: either have the keyfile re-created each time, or have the keyfile only deleted after the build (documented behaviour)

       

        Attachments

          Activity

          lifeofguenter Gunter Grodotzki created issue -
          Hide
          julian_alarcon Julian Alarcon added a comment -
          Show
          julian_alarcon Julian Alarcon added a comment - Seems related to this issue: https://issues.jenkins-ci.org/browse/JENKINS-61341

            People

            • Assignee:
              Unassigned
              Reporter:
              lifeofguenter Gunter Grodotzki
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: