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

Pipeline Config: Getting env vars from Credentials

      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.

          [JENKINS-37778] Pipeline Config: Getting env vars from Credentials

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

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

              Created:
              Updated:
              Resolved: