-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
Can you please provide example or some documentation on how to use it declarative or scripted pipeline? I used as below,
#!groovy
node("master") {
stage ("List GCP Projects"){
withCredentials([[$class: 'FileBinding', credentialsId: 'my-project-id', variable: 'GOOGLE_APPLICATION_CREDENTIALS']]) {
sh "gcloud projects list --sort-by=projectId --limit=5"
}
}
}
But it giving error like,
ERROR: Credentials 'my-project-id' is of type 'Google Service Account from private key' where 'org.jenkinsci.plugins.plaincredentials.FileCredentials' was expected
I also tried using as given in file https://github.com/jenkinsci/google-oauth-plugin/blob/develop/Jenkinsfile.google
withCredentials([[$class: 'StringBinding', credentialsId: 'my-project-id', variable: 'GOOGLE_CREDENTIALS']]) {
sh "gcloud projects list --sort-by=projectId --limit=5"
}
But above gave me error like,
ERROR: Credentials 'my-project-id' is of type 'Google Service Account from private key' where 'org.jenkinsci.plugins.plaincredentials.StringCredentials' was expected
alexgeek, imonteroperez, sky-amoncadot, gumma1, medzin and 7 more
Metadata
Metadata
Assignees
Labels
No labels