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

Pipeline Config: Getting env vars from Credentials

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      What would be nice and idiomatic is to be able to something like:

      environment {
          AWS_ACCESS_KEY_ID = credentials(id='amazonKeyId')
          AWS_ACESS_KEY_SECRET = credentials(id='passwordId')
      }
      

      (or something more configgy looking). This can be limited to the single secret case if needed (ie not username/password).

      Using various incarnations of the wrapper:

      withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: '', passwordVariable: 'AWS_SECRET', usernameVariable: 'AWS_ID']]) {
          // some block
      }
      

      You can, I think get credentials back out but it is seems less configgy for common scenarious.

        Attachments

          Activity

          abayer Andrew Bayer created issue -
          abayer Andrew Bayer made changes -
          Field Original Value New Value
          Environment Pipeline Config 0.1
          rsandell rsandell made changes -
          Assignee Andrew Bayer [ abayer ] rsandell [ rsandell ]
          rsandell rsandell made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          rsandell rsandell made changes -
          Status In Progress [ 3 ] In Review [ 10005 ]
          rsandell rsandell made changes -
          Resolution Done [ 10000 ]
          Status In Review [ 10005 ] Resolved [ 5 ]
          bitwiseman Liam Newman made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            Assignee:
            rsandell rsandell
            Reporter:
            abayer Andrew Bayer
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: