diff --git a/docs/2.4/manual/dop/guides/reference/dice-yaml.md b/docs/2.4/manual/dop/guides/reference/dice-yaml.md index 5da06ddb..a95c6a78 100644 --- a/docs/2.4/manual/dop/guides/reference/dice-yaml.md +++ b/docs/2.4/manual/dop/guides/reference/dice-yaml.md @@ -20,9 +20,27 @@ envs: {} services: {} addons: {} + +environments: + development: + envs: {} + services: {} + addons: {} + test: + envs: {} + services: {} + addons: {} + staging: + envs: {} + services: {} + addons: {} + production: + envs: {} + services: {} + addons: {} ``` -dice.yml 文件的全局结构定义了 5 项全局配置,具体说明如下。 +dice.yml 文件的全局结构定义了 6 项全局配置,具体说明如下。 ### version @@ -379,6 +397,39 @@ options: create_dbs: blog,blog2 ``` +### environments 配置项 +environments 配置项可分为 development、test、staging 以及 production 四个 workspace 名称,分别代表开发环境、测试环境、预发环境和生产环境。 + +针对于不同的运行环境可以单独配置[envs](#envs)、[services](#service-配置项)、[addons](#addon-配置项)。 + +示例如下: +```yaml +environments: + production: + envs: + EXAMPLE_ENV: prod + staging: + envs: + EXAMPLE_ENV: staging + test: + envs: + EXAMPLE_ENV: test + services: + example_demo: + image: registry.erda.cloud/erda/go-demo:1719970022481890617 + resources: + cpu: 0.1 + mem: 256 + development: + envs: + EXAMPLE_ENV: dev + addons: + redis: + plan: redis:basic + options: + version: 6.2.10 +``` + ## 变量引用 ### 平台级变量 在 dice.yml 的 `.services[serviceName].endpoints[i].domain` 字段值中,可引用平台级变量,引用语法为 `${platform.Key}`。 diff --git a/docs/en/next/manual/dop/guides/reference/dice-yaml.md b/docs/en/next/manual/dop/guides/reference/dice-yaml.md index e64881c2..a245832d 100644 --- a/docs/en/next/manual/dop/guides/reference/dice-yaml.md +++ b/docs/en/next/manual/dop/guides/reference/dice-yaml.md @@ -20,9 +20,27 @@ envs: {} services: {} addons: {} + +environments: + development: + envs: {} + services: {} + addons: {} + test: + envs: {} + services: {} + addons: {} + staging: + envs: {} + services: {} + addons: {} + production: + envs: {} + services: {} + addons: {} ``` -The global structure of the dice.yml file defines 5 items of the global configuration, as described below. +The global structure of the dice.yml file defines 6 items of the global configuration, as described below. ### version @@ -366,6 +384,39 @@ options: create_dbs: blog,blog2 ``` +### environments +The environments configuration item can be categorized into four workspace names: development, test, staging, and production. + +You can configure [envs](#envs), [services](#service), and [addons](#addon) for different workspace. + +See the example below: +```yaml +environments: + production: + envs: + EXAMPLE_ENV: prod + staging: + envs: + EXAMPLE_ENV: staging + test: + envs: + EXAMPLE_ENV: test + services: + example_demo: + image: registry.erda.cloud/erda/go-demo:1719970022481890617 + resources: + cpu: 0.1 + mem: 256 + development: + envs: + EXAMPLE_ENV: dev + addons: + redis: + plan: redis:basic + options: + version: 6.2.10 +``` + ## Variable Reference ### Platform-Level Variable Platform-level variables can be referenced in the field value of `.services[serviceName].endpoints[i].domain` in the dice.yml with the syntax `${platform.Key}`. diff --git a/docs/next/manual/dop/guides/reference/dice-yaml.md b/docs/next/manual/dop/guides/reference/dice-yaml.md index 5da06ddb..a95c6a78 100644 --- a/docs/next/manual/dop/guides/reference/dice-yaml.md +++ b/docs/next/manual/dop/guides/reference/dice-yaml.md @@ -20,9 +20,27 @@ envs: {} services: {} addons: {} + +environments: + development: + envs: {} + services: {} + addons: {} + test: + envs: {} + services: {} + addons: {} + staging: + envs: {} + services: {} + addons: {} + production: + envs: {} + services: {} + addons: {} ``` -dice.yml 文件的全局结构定义了 5 项全局配置,具体说明如下。 +dice.yml 文件的全局结构定义了 6 项全局配置,具体说明如下。 ### version @@ -379,6 +397,39 @@ options: create_dbs: blog,blog2 ``` +### environments 配置项 +environments 配置项可分为 development、test、staging 以及 production 四个 workspace 名称,分别代表开发环境、测试环境、预发环境和生产环境。 + +针对于不同的运行环境可以单独配置[envs](#envs)、[services](#service-配置项)、[addons](#addon-配置项)。 + +示例如下: +```yaml +environments: + production: + envs: + EXAMPLE_ENV: prod + staging: + envs: + EXAMPLE_ENV: staging + test: + envs: + EXAMPLE_ENV: test + services: + example_demo: + image: registry.erda.cloud/erda/go-demo:1719970022481890617 + resources: + cpu: 0.1 + mem: 256 + development: + envs: + EXAMPLE_ENV: dev + addons: + redis: + plan: redis:basic + options: + version: 6.2.10 +``` + ## 变量引用 ### 平台级变量 在 dice.yml 的 `.services[serviceName].endpoints[i].domain` 字段值中,可引用平台级变量,引用语法为 `${platform.Key}`。