Provide some mechanism for looking up whether credentials exist in Pipeline

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

XMLWordPrintable

      In my use-case, I need to use the same Jenkinsfile on multiple Jenkins instances. The only differentiation between the two are the credentials which are available for use. (Basically, one instance is authorized for deployments, thus the credentials, the other is not).

      My ideal would be a credentials global variable, or something like that, which could have utility methods like this. E.g.

      node {
        if (credentials.lookup('some-credentials-id')) {
          withCredentials('some-credentials-id') {
            sh './deploy.sh'
          }
        }
      }
      

      Related to JENKINS-37863

            Assignee:
            Unassigned
            Reporter:
            R. Tyler Croy
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: