From 1f98d1c3e36b9ee9ff08eb7a38c3fb1ec7247c56 Mon Sep 17 00:00:00 2001 From: Evan Read Date: Thu, 12 May 2022 12:19:25 +1000 Subject: Add make targets for fetching all documentation projects This makes the link checking make targets more robust by ensuring all prerequisite projects are present. --- Makefile | 28 +++++++++++++++++++++++--- doc/setup.md | 66 ++++++------------------------------------------------------ 2 files changed, 31 insertions(+), 63 deletions(-) diff --git a/Makefile b/Makefile index b3c74116..865d90fd 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,27 @@ .PHONY: all clean test up +../gitlab/.git: + @echo "\nINFO: Cloning GitLab project into parent directory.." + @git clone git@gitlab.com:gitlab-org/gitlab.git ../gitlab + +../gitlab-runner/.git: + @echo "\nINFO: Cloning GitLab Runner project into parent directory.." + @git clone git@gitlab.com:gitlab-org/gitlab-runner.git ../gitlab-runner + +../omnibus-gitlab/.git: + @echo "\nINFO: Cloning Omnibus GitLab project into parent directory.." + @git clone git@gitlab.com:gitlab-org/omnibus-gitlab.git ../omnibus-gitlab + +../charts-gitlab/.git: + @echo "\nINFO: Cloning GitLab Chart project into parent directory.." + @git clone git@gitlab.com:gitlab-org/charts/gitlab.git ../charts-gitlab + +../gitlab-operator/.git: + @echo "\nINFO: Cloning GitLab Operator project into parent directory.." + @git clone git@gitlab.com:gitlab-org/cloud-native/gitlab-operator.git ../gitlab-operator + +clone-all-docs-projects: ../gitlab/.git ../gitlab-runner/.git ../omnibus-gitlab/.git ../charts-gitlab/.git ../gitlab-operator/.git + up: setup view compile: setup @@ -17,13 +39,13 @@ setup: clean: @rm -rf tmp public -internal-links-check: compile +internal-links-check: clone-all-docs-projects compile @bundle exec nanoc check internal_links -internal-anchors-check: compile +internal-anchors-check: clone-all-docs-projects compile @bundle exec nanoc check internal_anchors -internal-links-and-anchors-check: compile +internal-links-and-anchors-check: clone-all-docs-projects compile @parallel time bundle exec nanoc check ::: internal_links internal_anchors external-links-check: compile diff --git a/doc/setup.md b/doc/setup.md index c6cf1064..95ddd666 100644 --- a/doc/setup.md +++ b/doc/setup.md @@ -163,68 +163,14 @@ For more information, see the [troubleshooting section](#troubleshooting). ## Clone the repositories -Since this process clones a few repositories, it might be a good idea to -create a separate directory to have them all together. For example, to store all -local checkouts in a `dev` directory: +To build the full GitLab documentation website locally, you must have cloned all the documentation projects that provide +Nanoc data sources. To clone all projects, run: -1. Open a terminal and run: - - ```shell - mkdir -p ~/dev - ``` - -1. Navigate to the directory you'd like the repositories to be cloned: - - ```shell - cd ~/dev - ``` - -1. Clone the documentation's website repository: - - ```shell - ## Using SSH (for GitLab Team members) - git clone git@gitlab.com:gitlab-org/gitlab-docs.git - - ## Using HTTPS (for external contributors) - git clone https://gitlab.com/gitlab-org/gitlab-docs.git - ``` +```shell +make clone-all-docs-projects +``` -1. Clone the repositories you wish to contribute documentation changes to. Clone these projects - **in the same directory** as the `gitlab-docs` project - (see [data sources](#nanoc-data-sources)). For example, `~/dev`: - - - **GitLab contributors** that don't have Developer access to the projects, - fork the ones you want and then clone them by using your forked version: - - ```shell - ## Using HTTPS (for members that do not have Developer access) - git clone https://gitlab.com//gitlab.git - git clone https://gitlab.com//gitlab-runner.git - git clone https://gitlab.com//omnibus-gitlab.git - git clone https://gitlab.com//charts/gitlab.git charts-gitlab - git clone https://gitlab.com//gitlab-operator.git - ``` - - - For members that have Developer access (usually the - **GitLab Team members**), clone the required repositories using SSH: - - ```shell - ## Using SSH (for members that have Developer access) - git clone git@gitlab.com:gitlab-org/gitlab.git - git clone git@gitlab.com:gitlab-org/gitlab-runner.git - git clone git@gitlab.com:gitlab-org/omnibus-gitlab.git - git clone git@gitlab.com:gitlab-org/charts/gitlab.git charts-gitlab - git clone git@gitlab.com:gitlab-org/cloud-native/gitlab-operator.git - ``` - -If you cloned the projects into `~/dev`, you should now have the following projects: - -- `~/dev/gitlab-docs` -- `~/dev/gitlab` -- `~/dev/gitlab-runner` -- `~/dev/omnibus-gitlab` -- `~/dev/charts-gitlab` -- `~/dev/gitlab-operator` +The documentation projects are cloned into the parent directory. ## Preview the documentation website -- cgit v1.2.3