Deploy Review Apps

Hi.

I’m using GitLab for CI/CD. Already have my staging environment working tidy with Rancher.

Last week, GitLab announced Review Apps, which is basicaly a test environment for every merge request.

So if I open a merge request for the 22-header-color branch, the goal is to have instantly an endpoint in 22-header-color.mydomain.com with deployed branch image, for immediatly testing.

My question is how to set up this in Rancher, using Rancher’s API or rancher-compose (I prefer API). I need a load balancer that dynamically points to the correct service given the requested subdomain? How can I automate this?

I would appreciate any help.

Thanks in advance.

1 Like

You can do this in 1.2 by having a load balancer that uses a selector to find the services, and then putting a portRule on the service that says what hostnames should target it: http://docs.rancher.com/rancher/v1.2/en/cattle/adding-load-balancers/#selector