I have a plugin that extends the notifyCommit message received by the git-plugin Listener ExtensionPoint.
It's called CicdDiscover and what it does is handle the case where the url string passed in the /git/notifycommit?url-URL hook does NOT already exist in a Jenkins job. The plugin listens to the notifyCommit message, parses through using most of the original GitStatus.java code, does NOT schedule a build if the url string is found in a Jenkins job already configured. In the !urlFound and !scmFound cases, it calls new java methods that grab a template config.xml from a local template job, replace the template repo url with the url passed via the notifyCommit and then creates and enables a Jenkins job named for the repo. It then re-passes the /git/notifyCommit?url=URL string back to localhost, this time to be handled and scheduled by the git-plugin. This was developed to extend Verizon/AOL's CICD structure and allow Jenkins hosts to be hands-off for DevOps - we no longer have to work with developers to configure their builds. The developers use a template repo which contains a structure CICD directory with subdirectories for CICD/packer, CICD/ansible, CICD/jenkins, CICD/maven, etc that can be pulled in by the repo checkout. The job's config.xml is identical except for the repo string from job to job, the SCM polling is configured at every hour and even for coincident commits to the same repo and different branches, eventually all branches are built. The variance in the build jobs is pushed out into the git repo with pipeline jobs constructing the variations in developer build requirements. The closest plugin I could find that approached solving this was a Gitlabs hook plugin - which also created jobs in Jenkins, but was limited in scope to gitlabs. I hope this solves a problem. AOL wants to release as much as possible back to the open source community, so we are looking at releasing it back to Jenkins development. -- Doug Munsinger DevOps Engineer, AOL (<- Millennial Media <- Jumptap) 155 Seaport Blvd, 8th Floor, Boston, MA 02210 -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/bbdff2e5-19b3-4067-bcee-7c0e065aa13b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
