How to use multiple credentials in withCredentials in Jenkins Pipeline

后端 未结 2 1099
小蘑菇
小蘑菇 2021-02-02 05:05

I have the following step in my declarative jenkins pipeline: I create script which comes from my resources/ folder using libraryResource. This script contains cred

2条回答
  •  无人共我
    2021-02-02 06:01

    Also, you can use this with $class

                        withCredentials([[
                          $class: 'AmazonWebServicesCredentialsBinding',
                          credentialsId: 'awsID',
                          accessKeyVariable: 'AWS_ACCESS_KEY_ID',
                          secretKeyVariable: 'AWS_SECRET_ACCESS_KEY'],
    
                        [$class: 'UsernamePasswordMultiBinding',
                          credentialsId: 'myID',
                          usernameVariable: 'USR',
                          passwordVariable: 'PWD']])
    

提交回复
热议问题