Interview Prep/Jenkins/Shared libraries & multibranch

You need to share configuration (registry URL, Sonar server name, cluster names) across all pipelines without hardcoding. Where do you put it?

IntermediateScenarioShared libraries & multibranch
Answer

Situation read → Non-secret global settings.

What I'd do →

  1. Global environment variables set via JCasC (jenkins.globalNodeProperties.envVars), or folder-level properties for per-team values.
  2. Or a library resources/config/defaults.yaml read via readYaml text: libraryResource(...).
  3. Keep secrets in credentials, never in these.

Why → Values change in one place and are versioned with the platform code.

Interview tip → Folder properties allow team-specific overrides with the same variable names.

All Jenkins questions Roadmap: Jenkins

More on Shared libraries & multibranch