What does `credentials('id')` produce for each credential type in `environment`?
IntermediateConceptDeclarative pipeline syntax
Answer
| Credential type | Variables created for X = credentials('id') |
|---|---|
| Secret text | X = the secret |
| Username with password | X = user:pass, X_USR, X_PSW |
| Secret file | X = path to a temp file |
| SSH username with private key | X = path to key file, X_USR (and X_PSW for passphrase) |
All values are masked in the console log and the temp files are deleted when the block ends.
More on Declarative pipeline syntax
What is the minimum valid declarative pipeline?BeginnerWhat agent types exist in declarative pipelines?IntermediateWhen do you use `agent none` at the top level?IntermediateHow do nested sequential stages work and why are they useful?IntermediateList the `post` conditions and when each fires.IntermediateWhat are the most useful `when` conditions?Intermediate