Merging global node environment variables from multiple config files
See original GitHub issueYour checklist for this issue
- Jenkins version
2.223
- Plugin version
1.35
- OS
Ubuntu 18.04
Description
When having multiple .casc files to configure different aspects of Jenkins, if multiple files have global environment variables configuration, they are not merged, but stored as a separate envVars sections:
config1.yaml
jenkins:
globalNodeProperties:
- envVars:
env:
- key: VARIABLE1
value: foo
config2.yaml
jenkins:
globalNodeProperties:
- envVars:
env:
- key: VARIABLE2
value: bar
resulting config in Jenkins:
jenkins:
globalNodeProperties:
- envVars:
env:
- key: VARIABLE1
value: foo
- envVars:
env:
- key: VARIABLE2
value: bar
While tests show that all variables still end up in environment, when you go to Manage Jenkins -> Configure System, it only shows contents of first “envVars” block.
Expected: all global variables end up in a single “envVars” block thus avoiding visualization problem
jenkins:
globalNodeProperties:
- envVars:
env:
- key: VARIABLE1
value: foo
- key: VARIABLE2
value: bar
PS It seems that originally it is not expected to have multiple instances of the same type of global node properties descriptors.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Merge different config files in environment files - Stack Overflow
I'm trying to have separate config files which I import/merge in the environment files to provide a further global CONFIG object with all ......
Read more >Working with Environment Variables in Node.js - Twilio
Environment variables are a great way to configure parts of your Node.js application. Learn how to work with them using helpful tools such ......
Read more >Customizing Node.js .env files - LogRocket Blog
Learn how to configure a Node.js application via environment variables and customize an .env file with new environment variables.
Read more >Environment Variables .env with Node.js - YouTube
In this edition of Stripe Developer Office Hours, follow along as CJ Avilla walks through the fundamentals of managing environment variables ...
Read more >Organizing Cluster Access Using kubeconfig Files - Kubernetes
kube/config . If the KUBECONFIG environment variable does exist, kubectl uses an effective configuration that is the result of merging the files ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The #1218 PR is also adding a merge feature as I understand the PR. See the merge strategy called ErrorOnConflict. It is doing deep merging.
I would suggest re-opening this issue as it’s not currently fixed. PR #1218 does not yet support merging
we misread the comments on this issue and the other PR and assumed that we could merge envVars, then spent a bit of time trying to get it to work, then realized it wasn’t fully implemented yet. PR #1218 does support partial merging which is useful.