What are review apps and how are they implemented?
IntermediateConceptGitLab CI
Answer
A review app is a temporary environment deployed per merge request so reviewers can click through the change. You deploy to a dynamic environment name and define a stop job that runs when the MR closes or the branch is deleted.
review:
stage: deploy
script: ./deploy-review.sh $CI_COMMIT_REF_SLUG
environment:
name: review/$CI_COMMIT_REF_SLUG
url: https://$CI_COMMIT_REF_SLUG.review.example.com
on_stop: stop-review
rules: [{ if: $CI_PIPELINE_SOURCE == "merge_request_event" }]
stop-review:
stage: deploy
script: ./teardown-review.sh $CI_COMMIT_REF_SLUG
environment: { name: review/$CI_COMMIT_REF_SLUG, action: stop }
when: manual
More on GitLab CI
How does GitLab CI/CD work at a high level?BeginnerWhat is a GitLab Runner and what executors exist?IntermediateWhat are the types of runners (shared, group, project) and tags?IntermediateHow do `rules:` work and how do they replace `only/except`?IntermediateWhat are workflow rules and how do they prevent duplicate pipelines?AdvancedHow do artifacts and cache differ in GitLab CI?Intermediate