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

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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)

       

            Assignee:
            Unassigned
            Reporter:
            Günter Grodotzki
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: