Deployment

TOC

Build and Preview

Before deployment, we need to build the project for the production environment and preview it locally to ensure the project runs correctly:

doom build # Build static artifacts
doom serve # Preview the build artifacts in production mode

Multi-Version Builds

By default, doom build will output the build artifacts to the dist directory. If multiple versions of the documentation need to be built, you can specify the version number using the -v parameter, for example:

# Typically determined by the branch name, such as release-4.0 corresponding to version 4.0
doom build -v 4.0 # Build version 4.0, output artifacts to dist/4.0, documentation access path is {base}/4.0
doom build -v master # Build master version, output artifacts to dist/master, documentation access path is {base}/master
doom build -v {other} # Build other versions, output artifacts to dist/{other}, documentation access path is {base}/{other}

# unversioned and unversioned-x.y are special version numbers used for building documents without version prefixes
doom build -v unversioned # Build document without version prefix, output artifacts to dist/unversioned, documentation access path is {base}
doom build -v unversioned-4.0 # Build document without version prefix but display version number 4.0 in the navigation bar, output artifacts to dist/unversioned, documentation access path is {base}

Merged Directory Structure

│── console-platform
   ├── 4.0
   ├── 4.1
   ├── index.html
   ├── overrides.yaml
   └── versions.yaml
│── console-devops-docs
   ├── 4.0
   ├── 4.1
   ├── index.html
   ├── overrides.yaml
   └── versions.yaml
│── console-tekton-docs
   ├── 1.0
   ├── 1.1
   ├── index.html
   ├── overrides.yaml
   └── versions.yaml
<!DOCTYPE html>
<html>
  <head>
    <title>Redirecting...</title>
    <meta http-equiv="refresh" content="0; url=/console-docs/4.1" />
  </head>
  <body>
    <p>Redirecting to <a href="/console-docs/4.1">/console-docs/4.1</a></p>
  </body>
</html>

Dynamic Mounting Configuration File

# Document information, each document can mount to override default configuration
title:
  en: Doom - Alauda
  zh: Doom - 灵雀云
logoText:
  en: Doom - Alauda
  zh: Doom - 灵雀云
- '4.1'
- '4.0'