.review-docs: image: ruby:3.4-alpine3.23 extends: .documentation stage: review # Overrides .documentation: cancelling these mid-run would leave the docs # review environment in an inconsistent state. interruptible: false cache: {} dependencies: [] before_script: - gem install gitlab --no-doc # We need to download the script rather than clone the repo since the # review-docs-cleanup job will not be able to run when the branch gets # deleted (when merging the MR). - apk add --update openssl - wget https://gitlab.com/gitlab-org/gitlab/-/raw/master/scripts/trigger-build.rb - chmod 755 trigger-build.rb secrets: DOCS_PROJECT_API_TOKEN: gitlab_secrets_manager: name: DOCS_PROJECT_API_TOKEN source: group/gitlab-org file: false DOCS_TRIGGER_TOKEN: gitlab_secrets_manager: name: DOCS_TRIGGER_TOKEN source: group/gitlab-org file: false variables: GIT_STRATEGY: none DOCS_GITLAB_REPO_SUFFIX: cli # By default, deploy the Review App using the `main` branch of the `gitlab-org/gitlab-docs` project DOCS_BRANCH: main # Overrides .documentation: only offer a preview when the docs change. rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" changes: - "docs/**/*" - "docs-locale/**/*" when: manual allow_failure: true # Trigger a docs build in docs-gitlab-com project # Useful to preview the docs changes live # https://docs.gitlab.com/development/documentation/review_apps/ review-docs-deploy: extends: - .review-docs environment: name: docs-review/mr-${CI_MERGE_REQUEST_IID} url: https://docs-upstream-${DOCS_GITLAB_REPO_SUFFIX}-${CI_MERGE_REQUEST_IID}.gitlab-marketing.workers.dev/${DOCS_GITLAB_REPO_SUFFIX} auto_stop_in: 2 weeks on_stop: review-docs-cleanup script: - ./trigger-build.rb docs deploy # Cleanup remote environment of docs-gitlab-com review-docs-cleanup: extends: - .review-docs environment: name: docs-review/mr-${CI_MERGE_REQUEST_IID} action: stop script: - ./trigger-build.rb docs cleanup