summaryrefslogtreecommitdiff
path: root/doc/ci/environments.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ci/environments.md')
-rw-r--r--doc/ci/environments.md33
1 files changed, 33 insertions, 0 deletions
diff --git a/doc/ci/environments.md b/doc/ci/environments.md
index fe66f7e3c28..3327445724d 100644
--- a/doc/ci/environments.md
+++ b/doc/ci/environments.md
@@ -598,6 +598,38 @@ fetch line:
fetch = +refs/environments/*:refs/remotes/origin/environments/*
```
+## Scoping environments with specs **[PREMIUM]**
+
+Some GitLab [Enterprise Edition](https://about.gitlab.com/pricing/) features can behave differently for each [Environment](#introduction-to-environments-and-deployments).
+For example, you can [create a secret variable to be injected only into a production environment](variables/README.md#limiting-environment-scopes-of-variables-premium).
+In most cases, these features use the _environment specs_ mechanism, which offers
+an efficient way to implement scoping within each environment group.
+
+Let's say there are four environments:
+
+- `production`
+- `staging`
+- `review/feature-1`
+- `review/feature-2`
+
+Each environment can be matched with the following environment spec:
+
+| Environment Spec | `production` | `staging` | `review/feature-1` | `review/feature-2` |
+| ---------------- | ---------- | ------- | ---------------- | ---------------- |
+| * | Matched | Matched | Matched | Matched |
+| production | Matched | | | |
+| staging | | Matched | | |
+| review/* | | | Matched | Matched |
+| review/feature-1 | | | Matched | |
+
+As you can see, you can use specific matching for selecting a particular environment,
+and also use wildcard matching (`*`) for selecting a particular environment group,
+such as [Review apps](review_apps/index.md) (`review/*`).
+
+NOTE: **Note:**
+The most _specific_ spec takes precedence over the other wildcard matching.
+In this case, `review/feature-1` spec takes precedence over `review/*` and `*` specs.
+
## Limitations
1. You are limited to use only the [CI predefined variables][variables] in the
@@ -611,6 +643,7 @@ Below are some links you may find interesting:
- [The `.gitlab-ci.yml` definition of environments](yaml/README.md#environment)
- [A blog post on Deployments & Environments](https://about.gitlab.com/2016/08/26/ci-deployment-and-environments/)
- [Review Apps - Use dynamic environments to deploy your code for every branch](review_apps/index.md)
+- [Deploy Boards for your applications running on Kubernetes](../user/project/deploy_boards.md)
[Pipelines]: pipelines.md
[jobs]: yaml/README.md#jobs