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 →
- Global environment variables set via JCasC (
jenkins.globalNodeProperties.envVars), or folder-level properties for per-team values. - Or a library
resources/config/defaults.yamlread viareadYaml text: libraryResource(...). - 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.
More on Shared libraries & multibranch
A shared library change merged to `main` broke 200 pipelines within minutes. How do you prevent a repeat?IntermediateYou want to test a library branch against a real app pipeline without affecting anyone. How?BeginnerEvery app repo has its own pod YAML for builds, and they all drift. How do you standardize?IntermediateSecurity wants every pipeline to run a secret scan, even if teams forget to add it. How?AdvancedA multibranch project has 600 stale branch jobs and the folder page takes 30 seconds to load. What do you do?BeginnerA new org with 150 repositories wants Jenkins builds for every repo with a Jenkinsfile, without tickets to the platform team. What do you set up?Intermediate