So I’m working on a jenkins wrapper cookbook (using the daften:feature/jenkins2 branch for the Jenkins cookbook, as we’re using 2.x), and right now I’ve got a set of cookbook_files that contain the jobs, in subdirectories for each environment. So for our Bellevue office, they’re in cookbook moxie-jenkins/files/default/bel_jobs/filename.xml.
Right now I’m defining a static list of each of these in the recipe, looping over them to determine the filename, doing cookbook_file on that, and then jenkins_job on each xml file. Is there a better way that I can handle determining the list of jobs? Ultimately it would be nice to just be able to add the job file to the right directory, bump the version, and have it get autodetected. I’m not really sure how to go about that, though. Suggestions welcome.
I’ve considered creating databag items for each job instead, but then we’d be managing a set of JSON files for XML content and that doesn’t seem like a good route to go down. Plus I know how to look up a databag item, but I’m not sure how to get a list of the items (although I suspect that is available in the API and I just don’t know the method).
Thanks for any suggestions.