Offer code snippet for Review Apps with conditional "Enable Review App" button - non k8s
Problem to solve
If a user wants to add a review app after the .gitlab-ci.yml file is created, it is very hard to follow the documentation and we should offer guidance as part of the flow.
.gitlab-ci.yml file does not have a stage that has
only: - branches
associated to it, the "Enable Review App" button should be available.
Upon clicking the button, the following code snippet should be offered:
deploy review: stage: deploy review only: - branches except: - master environment: name: review/$CI_COMMIT_REF_NAME url: http://$CI_ENVIRONMENT_SLUG script:
If the above conditions are met display an
Enable Review App button on merge requests