Injecting Jenkins Credentials into a Build Job: Difference between revisions
Jump to navigation
Jump to search
Line 16: | Line 16: | ||
* [[Jenkins_Credentials_Plugin#Overview|Jenkins Credential Plugin]] has to be installed. | * [[Jenkins_Credentials_Plugin#Overview|Jenkins Credential Plugin]] has to be installed. | ||
* [[Jenkins_Credentials_Binding_Plugin#Overview|Jenkins Credentials Binding Plugin]] has to be installed. | * [[Jenkins_Credentials_Binding_Plugin#Overview|Jenkins Credentials Binding Plugin]] has to be installed. | ||
=Procedure= | |||
==Define the Credential== | |||
Credentials -> System -> Global credentials (unrestricted) -> Add Credential | |||
'''Username with password''' | |||
Scope: Global. The [[Jenkins_Security_Concepts#Global|Global scope]] is required if the credential must be exposed to the build jobs. |
Revision as of 20:02, 22 May 2018
External
- https://support.cloudbees.com/hc/en-us/articles/203802500-Injecting-Secrets-into-Jenkins-Build-Jobs
- https://support.cloudbees.com/hc/en-us/articles/204897020-Fetch-a-userid-and-password-from-a-Credential-object-in-a-Pipeline-job-
Internal
Overview
This article describes the procedure to declare credentials, in this case an external repository username and password, in a Jenkins credential store and then expose them to a build job, in this case a Gradle-driven build.
Pre-Requisites
- Jenkins Credential Plugin has to be installed.
- Jenkins Credentials Binding Plugin has to be installed.
Procedure
Define the Credential
Credentials -> System -> Global credentials (unrestricted) -> Add Credential
Username with password
Scope: Global. The Global scope is required if the credential must be exposed to the build jobs.