Hi! I can successfully configure manually (via the UI) a Multibranch Pipeline item and have some tests run on my project that is in a git repo.
I am trying to figure out how to configure the Multibranch Pipeline item with the configuration as code plugin. I have successfully used the configuration as code plugin to configure users, credentials, SSH keys to access the remote git repo, etc but
from “Dashboard → Manage Jenkins → Configuration as Code → View Configuration” I don’t see any entries related to the Multibranch Pipeline item
I am new to Jenkins so I might be looking at the wrong thing. I also hope this is the right place to ask a question about the configuration-as-code plugin
As far as I know, you can’t configure jobs with JCasc.
When I need to add jobs, I just create one within the Jenkins UI, then copy it from the filesystem to another Jenkins instance if needed.
First of all thanks, because I am new to jenkins and didn’t know that these “items” (as in “Dashboard → New Item”) are called “jobs”
I saw your approach and will follow it. I might be completely wrong, but from reading the docs I understand that it’s the Job DSL plugin that is responsible of generating the xml files in /var/lib/jenkins/jobs/JOB_NAME/ or can jenkins generate them on its own, without any help from a plugin?
@poddingue I’d like to ask what is the purpose of the jobs/JOB_NAME/indexing/indexing.xml
I notice that you store it in your git repo and then copy/restore to another jenkins (like I do - I restore it if I rebuild my jenkins VM image
However, I noticed that the contents of the file change during builds. So I am wondering if there is anything important stored in that file that could cause any jenkins data to go out of sync or in a bad state?
This is a diff of 2 different snapshots of indexing/indexing.xml from different times (after jenkins performed some builds)
This approach is a few months old and may not be the best example to follow. I apologize for any confusion caused. Currently, I simply copy the config.xml file, and it appears to be sufficient for the jobs to function in a new Jenkins instance.