Pipeline - how to have a global config that's accessible from every step?
I'm putting together a jenkins global library and am struggling with creating a true global configuration.
My Jenkinsfiles are pretty flat, and mostly just load the global library, set some build specific configuration values, and then calls a step that contains most of the build logic (calls other steps to run the build/test/install). What I was hoping I could do is have a separate properties file that I can load that contains a bunch of default global configuration values, and have it be accessible from all steps. Per the doc, I'm supposed to be able to create a class to hold this global config, but I have to actually pass this class into each step to make it available, which is really ugly.
I'm thinking the best approach is to create a config step that reads the file and loads the config, write that config to a file and stash it, then have a utility method that reads the stashed config in any steps that need to access it. Though, I also really don't like this option either.
Is there a good way in pipeline to make a globally accessible config that I'm missing?