Configurations
config.yml: configuring credentials
In Jenkins configurations section is explained how to add the required
credentials
. Here is explained how to use credentials with JePL itself. config
section of config.yml supports the keyword credentials that allows to define
an array of credentials of the following types:
secret text
username and password
secret file
ssh username with private key
certificate
The difference between them are the keywords for each one. The association is made by the credentials id from Jenkins, where the credential type is defined. The following table resumes the required parameters for each case:
Credential Type |
Properties |
---|---|
secret text |
|
username and password |
|
secret file |
|
ssh username with private key |
|
certificate |
|
In the next configuration examples, the values there have the following meaning:
jenkins_credential_id: this is the id associated to the Jenkins credential
ENV_*: name of the environment variable to be set with the correspondent value defined in Jenkins credential
- Examples:
config: credentials: - id: jenkins_credential_id variable: ENV_VAR
config: credentials: - id: jenkins_credential_id username_var: ENV_USER password_var: ENV_PASS
config: credentials: - id: jenkins_credential_id variable: ENV_VAR_FILE
config: credentials: - id: jenkins_credential_id keyfile_var: ENV_PRIVATE_KEY passphrase_var: ENV_PASS username_var: ENV_USER
config: credentials: - id: jenkins_credential_id keystore_var: ENV_KEYSTORE alias_var: ENV_CERT_ALIAS password_var: ENV_PASS