How do you inject secrets into JCasC without committing them?
AdvancedConceptPlugins, JCasC & Jenkins on Kubernetes
Answer
JCasC resolves ${VAR} placeholders from, in order, secret sources: environment variables, files in /run/secrets (Docker/Kubernetes secrets, filename = variable name), and plugins for Vault, AWS Secrets Manager or Kubernetes. ${VAR:-default} provides a default.
credentials:
system:
domainCredentials:
- credentials:
- string:
id: sonar-token
scope: GLOBAL
secret: "${SONAR_TOKEN}"
Use ^${VAR} to escape a literal ${...} that must not be resolved.
More on Plugins, JCasC & Jenkins on Kubernetes
How do you manage plugins in a reproducible way?IntermediateWhat does `jenkins-plugin-cli` resolve for you, and what flags matter?IntermediateWhy should you keep the number of plugins low?BeginnerWhat is JCasC and how is it loaded?BeginnerWhat are the top-level root elements in a JCasC file?IntermediateHow do you configure authorization with JCasC?Intermediate