Commit 82012d46 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Always run review app for docs-only branches

parent 2bac2918
...@@ -220,18 +220,6 @@ stages: ...@@ -220,18 +220,6 @@ stages:
paths: paths:
- log/development.log - log/development.log
# Review docs base
.review-docs: &review-docs
<<: *dedicated-runner
<<: *except-qa
<<: *single-script-job
variables:
<<: *single-script-job-variables
SCRIPT_NAME: trigger-build-docs
when: manual
only:
- branches
# DB migration, rollback, and seed jobs # DB migration, rollback, and seed jobs
.db-migrate-reset: &db-migrate-reset .db-migrate-reset: &db-migrate-reset
<<: *dedicated-no-docs-and-no-qa-pull-cache-job <<: *dedicated-no-docs-and-no-qa-pull-cache-job
...@@ -273,20 +261,44 @@ package-and-qa: ...@@ -273,20 +261,44 @@ package-and-qa:
- //@gitlab-org/gitlab-ce - //@gitlab-org/gitlab-ce
- //@gitlab-org/gitlab-ee - //@gitlab-org/gitlab-ee
# Trigger a docs build in gitlab-docs # Review docs base
# Useful to preview the docs changes live .review-docs: &review-docs
review-docs-deploy: <<: *dedicated-runner
<<: *review-docs <<: *single-script-job
stage: build variables:
<<: *single-script-job-variables
SCRIPT_NAME: trigger-build-docs
environment: environment:
name: review-docs/$CI_COMMIT_REF_NAME name: review-docs/$CI_COMMIT_REF_NAME
# DOCS_REVIEW_APPS_DOMAIN and DOCS_GITLAB_REPO_SUFFIX are secret variables # DOCS_REVIEW_APPS_DOMAIN and DOCS_GITLAB_REPO_SUFFIX are secret variables
# Discussion: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14236/diffs#note_40140693 # Discussion: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14236/diffs#note_40140693
url: http://$DOCS_GITLAB_REPO_SUFFIX-$CI_COMMIT_REF_SLUG.$DOCS_REVIEW_APPS_DOMAIN/$DOCS_GITLAB_REPO_SUFFIX url: http://$DOCS_GITLAB_REPO_SUFFIX-$CI_ENVIRONMENT_SLUG.$DOCS_REVIEW_APPS_DOMAIN/$DOCS_GITLAB_REPO_SUFFIX
on_stop: review-docs-cleanup on_stop: review-docs-cleanup
# Trigger a manual docs build in gitlab-docs only on non docs-only branches.
# Useful to preview the docs changes live.
review-docs-deploy-manual:
<<: *review-docs
stage: build
script:
- gem install gitlab --no-ri --no-rdoc
- ./$SCRIPT_NAME deploy
when: manual
only:
- branches
<<: *except-docs-and-qa
# Always trigger a docs build in gitlab-docs only on docs-only branches.
# Useful to preview the docs changes live.
review-docs-deploy:
<<: *review-docs
stage: post-test
script: script:
- gem install gitlab --no-ri --no-rdoc - gem install gitlab --no-ri --no-rdoc
- ./$SCRIPT_NAME deploy - ./$SCRIPT_NAME deploy
only:
- /(^docs[\/-].*|.*-docs$)/
<<: *except-qa
# Cleanup remote environment of gitlab-docs # Cleanup remote environment of gitlab-docs
review-docs-cleanup: review-docs-cleanup:
...@@ -295,6 +307,7 @@ review-docs-cleanup: ...@@ -295,6 +307,7 @@ review-docs-cleanup:
environment: environment:
name: review-docs/$CI_COMMIT_REF_NAME name: review-docs/$CI_COMMIT_REF_NAME
action: stop action: stop
when: manual
script: script:
- gem install gitlab --no-ri --no-rdoc - gem install gitlab --no-ri --no-rdoc
- ./SCRIPT_NAME cleanup - ./SCRIPT_NAME cleanup
......
...@@ -27,7 +27,7 @@ def docs_branch ...@@ -27,7 +27,7 @@ def docs_branch
# Prefix the remote branch with the slug of the project in order # Prefix the remote branch with the slug of the project in order
# to avoid name conflicts in the rare case the branch name already # to avoid name conflicts in the rare case the branch name already
# exists in the docs repo and truncate to max length. # exists in the docs repo and truncate to max length.
"#{slug}-#{ENV["CI_COMMIT_REF_SLUG"]}"[0...max] "#{slug}-#{ENV["CI_ENVIRONMENT_SLUG"]}"[0...max]
end end
# #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment