jenkinsci / google-oauth-plugin

This plugin implements the OAuth Credentials interfaces to surface Google Service Account credentials to Jenkins.
https://plugins.jenkins.io/google-oauth-plugin/
Apache License 2.0
37 stars 56 forks source link

add withCredentials support #182

Open ViliusS opened 1 year ago

ViliusS commented 1 year ago

What feature do you want to see added?

It would be very useful if this plugin would implement standard Credential Binging support via withCredentials. For now, if anyone needs to have Service Account JSON private key passed to let's say environment variable, you have to duplicate private key by uploading it to "Secret file" type. Then do:

withCredentials([file(credentialsId: 'privatekey-file', variable: 'GOOGLE_APPLICATION_CREDENTIALS')]) {
    sh "kubectl get pods"
}

So for Google Cloud and other Jenkins plugins "GoogleRobotPrivateKey" object is used, but for other custom stuff it's just a "Secret file".

Upstream changes

No response