Skip to content

Documentation Build

Gus edited this page Jan 14, 2019 · 16 revisions

Overview

The Datadog documentation contents live in many Github repository:

The idea behind it is to store content where it's created, and to display it where it's consumed.

On every documentation build (triggered by a Branch being merged to master) the script update_pre_build() is called. It pulls all content, transforms it, and puts it where it belong in the main documentation website.

Since #3749 the build strategy is defined in the file [pull_config.yaml] which has the following layout:

---
- org_name: <ORG_NAME>
  
  repos:
  - repo_name: <REPOSITORY_NAME>
    
    contents:

    - action: <ACTION_NAME>
      branch: <BRANCH_NAME>
      globs:
      - <GLOBS>
      options:
        <OPTIONS>

With the following variables:

Variable   Description
 <ORG_NAME>  Github organisation name to pull content from.
<REPOSITORY_NAME> Github repository name from <ORG_NAME> to pull content from.
 <BRANCH_NAME> Github branch name from <REPOSITORY_NAME> to pull content from.
<GLOBS> Globs of files to pull from the <ORG_NAME>/<REPOSITORY_NAME>/<BRANCH_NAME> tree.
<ACTION_NAME> Action to apply to the files pulled, refer to the Actions section to see the list of implemented actions.
<OPTIONS> Depending of the <ACTION_NAME>, list of optional parameter.

Actions

integrations

This creates an integration documentation page in https://docs.datadoghq.com/integrations/. In order to work <GLOBS> should include path to:

  • metadata.csv file
  • manifest.json file
  • README.md file

source

This is only for displaying the list of source attributes value available for the Dadadog API and shouldn't be used elsewhere

pull-and-push-files

This pull a single file from the specified upstream Github repository and display it in the Documentation, <OPTIONS> should then include:

Variable Description
dest_path  Path for the file within the documentation.
file_name New name for the file within the documentation.

pull-and-push-folder

This pull a folder and all its sub-folders from the specified upstream Github repository and display it in the Documentation repository with the same layout.

README.md files from the upstream repository are renamed to _index.md in order to match hugo internal logic. All links referring to another file from this folder in the upstream repository are replaced with relative link for the documentation repository.

<OPTIONS> should then include:

Variable Description
dest_dir  New folder path in the documentation repository to push content to. 
path_to_remove If the upstream folder isn't at the root of the Github repository, enter the path to remove from all files in order to avoid nested folders within the documentation repository