Per-Branch Deploys

Hello there!

We are on a self-managed GitLab running 12.6.6-ee

We have our CI set up to Build our docker images, a custom docker image to Publish their helm charts to a private repo, and then Deploy (either automatically on CI, or manually in QA, Pre-Prod, and Prod) to our Rancher 2 Kubernetes cluster.

Something I’m currently working on is implementing per-branch deploys - having these deploys have custom logic surrounding MRs. Spinning up a new one with its own custom path upon creation of a new MR, updating the image alongside MR updates, and spinning down once the MR closes / merges.

Unfortunately I’ve not been having much luck with this.

I am able to get things moving upon MR creation by using only: merge_requests, but have not yet been able to set up any logic with MRs closing or merging. I’ve combed through the documents and forum posts looking for similar approaches others have taken, but the ones I’ve tried so far aren’t cooperating (most recently was trying with Pipeline Triggers and Project Hooks).

Would definitely love some pushes in the right direction towards how I can / should be properly using these events to trigger different events =]

Thank you!