Add UI way to 'dynamically' deploy to environments
Problem to solve
Currently there is no easy way to dynamically deploy to an environment, that is if we create an environment in the web UI our CI/CD pipeline doesn't know about it. It would be great to have this option, as this is the most mayor thing I am missing from Gitlab CI/CD that Bamboo has.
Existing personas are:
Sasha, Software Developer, https://design.gitlab.com/research/personas#persona-sasha
Devon, DevOps Engineer, https://design.gitlab.com/research/personas#persona-devon
I really like the idea that environments should not (always) be defined in code, but in a configuration, for example in the web UI. If we combine having dynamic environments with #20367 (comment 51692949) we can have a way to deploy to different environments without updating code.
Add a way to a
.gitlab-ci.yml to detect a dynamically created environment with some environment variable and deploy to there. I'm not entirely sure how to fully do this, because there might be jobs/stages in the
.gitlab-ci.yml file which do not have to be run for every environment (like building some Docker image and pushing it for example). Perhaps we could add something like this to the YAML format:
deploy: stage: deploy script: - some script here environment: kind: dynamic
which would then be picked up by the CI/CD runner to know that it should not run this job/stage unless we press a button in the UI to "deploy to this environment"
Note that Bamboo has solved this by splitting up the CI/CD in two parts: a build plan and a deployment plan, where the latter can have multiple environments.
What does success look like, and how can we measure that?
When I go
Projects -> Operations -> Environments and click on an environment, I can click a button
Deploy to this environment, where I can chose which pipeline (or branch?) to deploy to that environment. The pipeline is then deployed to that environment, taking into account the environment specific variables for that environment.
Ideally I can also set environment specific variables on the environment edit page instead of it being "hidden" in the CI/CD settings page.
Links / references
- Request to set environment specific variables at the environment page: #20367 (comment 51692949)
- Bamboo deployment projects: https://confluence.atlassian.com/bamboo/deployment-projects-338363438.html