Use the same path of the docs site as in production

This started with
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24339 where a
broken link was introduced, but the lint checker never caught it.

The docs-lint job does the following:

```yaml
  script:
    - mv doc/ /tmp/gitlab-docs/content/
    - cd /tmp/gitlab-docs
    # Build HTML from Markdown
    - bundle exec nanoc
    # Check the internal links
    - bundle exec nanoc check internal_links
```

It moves the `doc/` dir inside `content` where Nanoc is expecting the
markdown files to be. It then builds the site and finally checks for
the links. If the built website was deployed to production, that would
be under `docs.gitlab.com/doc`.

The interesting part here is that
`[the logs](/doc/administration/logs.md#productionlog)`
translates to `<a href="/doc/administration/logs.html#productionlog>`,
so, Nanoc correctly sees this as an existing file!

This MR changes the path of the docs content to be equal to
$DOCS_GITLAB_REPO_SUFFIX which is defined as an environment
variable and takes the value of the slug of each project:
'ce', 'ee', 'omnibus', 'runner'.
parent 768475bd
......@@ -546,7 +546,7 @@ docs lint:
script:
- scripts/lint-doc.sh
- scripts/lint-changelog-yaml
- mv doc/ /tmp/gitlab-docs/content/
- mv doc/ /tmp/gitlab-docs/content/$DOCS_GITLAB_REPO_SUFFIX
- cd /tmp/gitlab-docs
# Build HTML from Markdown
- bundle exec nanoc
......
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