Jenkins Multi-branch: How do I add functionality to branch creation/deletion? Jenkins Multi-branch: How do I add functionality to branch creation/deletion? jenkins jenkins

Jenkins Multi-branch: How do I add functionality to branch creation/deletion?


You can use the MultiBranch Action Triggers plugin. With this plugin you run external jobs on branch creation/deletion. You need to create external pipelines which will do things on OpenShift.


First, allocation of your resources could be part of the pipeline stage:

  • Allocating blindly to OpenShift and store the branch/resource id within a file
  • Then check this allocation file in the next build before a new allocation

OR

  • You could first interrogate OpenShift for allocated

Finally, you can build another Jenkins job (scheduled, crontab-like based) for housekeeping.

This one could fetch out the available branch and compare to OpenShift allocated resources (or by an ad hoc file, or by fetching directly from OpenShift) and then call for the cleanup script.