When i create a new merge request on Gitlab, i want to create a preview environment based on my feature branch and have a link to access it.
What would be the steps for implementing that ? And the possible problems ?
Due to my company security policy we can’t use apps like Bunnyshel, Qovery, Render or even Review apps from Gitlab…
Thus i want to use docker to create the preview environment.
2
Answers
You can’t use GitLab CI to host a Docker container, thus you need an environment to deploy into. GitLab’s Review Apps are meant for static files, they cannot host Docker containers.
Alternatively, you could build and deploy a Docker container via GitLab Runner into its host Virtual Machine or Kubernetes cluster, but only if the infrastructure team allows it. It would help if you checked what CI executor the runner uses, and we can build from there. Depending on the Runner’s executor, it could need additional permissions to deploy a new container.
You could also use GitLab CI to push static files into a Google Cloud, AWS, or some other Cloud bucket and make them publicly available.
Please provide more context so I can give a specific answer.
GitLab CI is meant for building image not "previewing" them. However, if you setup a Gitlab CI runner in a kubernetes cluster you can create a job to deploy your image there to see how it runs.
There is a lot to go through though. You can get started here:
https://docs.gitlab.com/runner/