Re: Access to Gitlab Api Token via Credential Provider in a Job DSL Groovy Script

2020-03-30 Thread 'Sandra Parsick' via Jenkins Users
My colleague pointed me in. The trick is to iterate over all CredentialsProvider and filter by id: @Field def privateToken = CredentialsProvider .lookupCredentials(StandardCredentials, (Item) null, ACL.SYSTEM) .find { it.id == "gitlab-api" } .apiToken Am Freitag, 15. Mä

Access to Gitlab Api Token via Credential Provider in a Job DSL Groovy Script

2019-03-15 Thread 'Sandra Parsick' via Jenkins Users
Hello, I'm currently programming a Seed Job that requests via REST API a list of repositories from a Gitlab instance. I want to iterate this list and create a pipeline job for each repository. My idea is to use Gitlab plugin and Credential Plugin for storing the API token and the Job DSL plugin