Allow review apps to leverage a downstream deployment project
Problem to solve
Sometimes a project is mediated by another "deployment project" for its deployment. Consider, for instance, a micro services architecture, where individual microservices have to rely on others to execute successfully. In this case, it would be interesting to rely on a downstream deployment project that assembles microservices to deploy review apps.
Intended users
Persona: DevOps Engineer Persona: Software developer
Further Details
The use case:
A minimum viable example of the problem occurs when you have at least two microservices that needs to be deployed as one.
Say for example you have a service "Frontend" and a service "Backend" that deploys as a Docker Stack to Docker Swarm (or Kubernetes, etc, etc).
You create a third repository "Deployment" to host the docker-compose.yml files and related deployment configurations.
Now to deploy the project you need a .gitlab-ci.yml
config in the "Deployment" repository that can perform the deployment of both microservices.
Then you want to deploy review apps for either the "Frontend" repo, the "Backend" repo, or both, as these have to trigger pipelines in the "Deployment" repo to actually perform the deployment.
To do this you want to have a bridge job in the microservice repos that spin off a pipeline in the "Deployment" repo.
This bridge job could have used the old multi-pipeline API too, but that API is really ugly so we want to avoid using it as much as possible.
So far so good. Now the problem arises when you want to leverage GitLab's review apps integration which links review apps with merge requests and automatically stops them when the MR is merged, etc. To do this you need to use the environment functionaliy in the .gitlab-ci.yml file in "Frontend" and "Backend", but since bridge jobs and environment don't work togehter this gets a bit hairy.
The workaround is to split the job into two, one bridge job to "Deployment" and a no-op job with the environment in both of the microservice repos. This works to a degree, but the automatic shutdown of running review apps does not work properly.
Proposal
Allow review apps to leverage a downstream deployment project
Links / references
ZD https://gitlab.zendesk.com/agent/tickets/126191 (internal)
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.