GitLab Docs in GDK
You can use the GDK to contribute GitLab documentation. The GDK can:
- Maintain a clone of the
docs-gitlab-comrepository for work on changes to that project. - Preview changes made in the GDK-managed
gitlab/docdirectory.
If you want to contribute to GitLab documentation without using GDK, see Set up local development and preview.
Configure GitLab Docs in GDK
GDK provides several configuration options.
Enable GitLab Docs previews
To enable previewing GitLab documentation by using the docs-gitlab-com project:
Enable the
docs-gitlab-comintegration:gdk config set docs_gitlab_com.enabled trueReconfigure GDK:
gdk reconfigure
Disable GitLab Docs previews
To disable previewing GitLab documentation by using the docs-gitlab-com project:
Disable the
docs-gitlab-comintegration:gdk config set docs_gitlab_com.enabled falseReconfigure GDK:
gdk reconfigure
Disable automatic updates
To avoid automatically updating the docs-gitlab-com checkout, run:
gdk config set docs_gitlab_com.auto_update falseConfigure a custom port
The default port is 1313 but this can be customized:
gdk config set docs_gitlab_com.port 1314Configure HTTPS
You can run the GitLab Docs site using HTTPS. For more information, see NGINX.
Include more documentation
The full published documentation suite
includes additional documentation
from outside the
gitlab project.
To make and preview changes to the additional documentation:
Run the following commands as required:
gdk config set gitlab_runner.enabled true gdk config set omnibus_gitlab.enabled true gdk config set charts_gitlab.enabled true gdk config set gitlab_operator.enabled trueRun
gdk updateto:- Clone the additional projects for the first time, or update existing local copies.
- Compile a published version of the additional documentation.
Start the
docs-gitlab-comservice if not already running:gdk start docs-gitlab-com
Note
gitlab_runner should not be confused with
runner.
By default, the cloned repositories of the gitlab_runner, omnibus_gitlab, charts_gitlab, and gitlab_operator
components are:
Updated automatically when you run
gdk update. To disable this, setauto_update: falseagainst whichever project to disable.Cloned using HTTPS. If you originally cloned
gitlabusing SSH, you might want to set these cloned repositories to SSH also. To set these repositories to SSH:Go into each cloned repository and run
git remote -vto review the current settings.To switch to SSH, run
git remote set-url <remote name> git@gitlab.com:gitlab-org/<project path>.git. For example, to update your HTTPS-clonedgitlab-runnerrepository (with aremotecalledorigin), run:cd <GDK root path>/gitlab-runner git remote set-url origin git@gitlab.com:gitlab-org/gitlab-runner.gitRun
git remote -vin each cloned repository to verify that you have successfully made the change from HTTPS to SSH.
Make and preview documentation changes
You can preview documentation changes as they would appear when published on GitLab Docs.
To make changes to GitLab documentation and preview them:
Start the
docs-gitlab-comservice and ensure you can preview the documentation site:gdk start docs-gitlab-comMake the necessary changes to the files in
<path_to_gdk>/gitlab/doc.View the preview. You must restart the
docs-gitlab-comservice to recompile the published version of the documentation with the new changes:gdk restart docs-gitlab-comYou can
tailthedocs-gitlab-comlogs to see progress on rebuilding the documentation:gdk tail docs-gitlab-com
Troubleshooting
Documentation from disabled projects appears in preview
Disabling additional documentation projects doesn’t remove them from your file system and Hugo continues to use them as a source of documentation. When disabled, the projects aren’t updated so Hugo is using old commits to preview the data from those projects.
To ensure only enabled projects appear in the preview:
- Disable any projects you don’t want previewed.
- Remove the cloned project directory from inside your GDK directory.