Read about our upcoming Code of Conduct on this issue

docs.gitlab-ci.yml 2.43 KB
Newer Older
Stan Hu's avatar
Stan Hu committed
1
2
3
.review-docs:
  extends:
    - .default-retry
4
    - .docs:rules:review-docs
5
  allow_failure: true
Stan Hu's avatar
Stan Hu committed
6
7
8
  image: ruby:2.6-alpine
  stage: review
  dependencies: []
Kamil Trzciński's avatar
Kamil Trzciński committed
9
  variables:
10
11
12
13
    # We're cloning the repo instead of downloading the script for now
    # because some repos are private and CI_JOB_TOKEN cannot access files.
    # See https://gitlab.com/gitlab-org/gitlab/issues/191273
    GIT_DEPTH: 1
Kamil Trzciński's avatar
Kamil Trzciński committed
14
  environment:
15
    name: review-docs/$DOCS_GITLAB_REPO_SUFFIX-$CI_MERGE_REQUEST_IID
Kamil Trzciński's avatar
Kamil Trzciński committed
16
    # DOCS_REVIEW_APPS_DOMAIN and DOCS_GITLAB_REPO_SUFFIX are CI variables
17
    # Discussion: https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/14236/diffs#note_40140693
18
    auto_stop_in: 2 weeks
19
    url: http://docs-preview-$DOCS_GITLAB_REPO_SUFFIX-$CI_MERGE_REQUEST_IID.$DOCS_REVIEW_APPS_DOMAIN/$DOCS_GITLAB_REPO_SUFFIX
Kamil Trzciński's avatar
Kamil Trzciński committed
20
    on_stop: review-docs-cleanup
Stan Hu's avatar
Stan Hu committed
21
22
  before_script:
    - apk add --update openssl
23
24
    - gem install httparty --no-document --version 0.17.3
    - gem install gitlab --no-document --version 4.13.0
Kamil Trzciński's avatar
Kamil Trzciński committed
25
26
27
28

# Always trigger a docs build in gitlab-docs only on docs-only branches.
# Useful to preview the docs changes live.
review-docs-deploy:
29
  extends: .review-docs
Kamil Trzciński's avatar
Kamil Trzciński committed
30
  script:
31
    - ./scripts/trigger-build-docs deploy
Kamil Trzciński's avatar
Kamil Trzciński committed
32
33
34

# Cleanup remote environment of gitlab-docs
review-docs-cleanup:
35
  extends: .review-docs
Kamil Trzciński's avatar
Kamil Trzciński committed
36
  environment:
37
    name: review-docs/$DOCS_GITLAB_REPO_SUFFIX-$CI_MERGE_REQUEST_IID
Kamil Trzciński's avatar
Kamil Trzciński committed
38
39
    action: stop
  script:
40
    - ./scripts/trigger-build-docs cleanup
Kamil Trzciński's avatar
Kamil Trzciński committed
41
42

docs lint:
Stan Hu's avatar
Stan Hu committed
43
44
  extends:
    - .default-retry
45
    - .docs:rules:docs-lint
46
  image: "registry.gitlab.com/gitlab-org/gitlab-docs:lint"
Kamil Trzciński's avatar
Kamil Trzciński committed
47
  stage: test
48
  needs: []
Kamil Trzciński's avatar
Kamil Trzciński committed
49
50
  script:
    - scripts/lint-doc.sh
51
    # Prepare docs for build
52
53
54
    # The path must be 'ee/' because we have hardcoded links relying on it
    # https://gitlab.com/gitlab-org/gitlab-docs/-/blob/887850752fc0e72856da6632db132f005ba77f16/content/index.erb#L44-63
    - mv doc/ /tmp/gitlab-docs/content/ee
Kamil Trzciński's avatar
Kamil Trzciński committed
55
56
57
58
59
60
61
    - cd /tmp/gitlab-docs
    # Build HTML from Markdown
    - bundle exec nanoc
    # Check the internal links
    - bundle exec nanoc check internal_links
    # Check the internal anchor links
    - bundle exec nanoc check internal_anchors
62

63
graphql-reference-verify:
64
65
66
67
  extends:
    - .default-retry
    - .default-cache
    - .default-before_script
68
    - .docs:rules:graphql-reference-verify
69
    - .use-pg11
70
  stage: test
71
  needs: ["setup-test-env pg11"]
72
73
  script:
    - bundle exec rake gitlab:graphql:check_docs
74
    - bundle exec rake gitlab:graphql:check_schema