Commit edc9e862 authored by Marcia Ramos's avatar Marcia Ramos

Merge branch 'docs-clarify-environment-action-prepare-header' into 'master'

Clarify environment:action:prepare headline

See merge request gitlab-org/gitlab!56894
parents f1c63c0a da7c2528
......@@ -497,19 +497,17 @@ To delete a stopped environment in the GitLab UI:
1. Next to the environment you want to delete, select **Delete environment**.
1. On the confirmation dialog box, select **Delete environment**.
### Prepare an environment
### Prepare an environment without creating a deployment
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/208655) in GitLab 13.2.
By default, GitLab creates a deployment every time a
build with the specified environment runs. Newer deployments can also
[cancel older ones](deployment_safety.md#skip-outdated-deployment-jobs).
By default, whenever GitLab CI/CD runs a job for a specific environment, it
triggers a deployment and [(optionally) cancels outdated
deployments](deployment_safety.md#ensure-only-one-deployment-job-runs-at-a-time).
You may want to specify an environment keyword to
[protect builds from unauthorized access](protected_environments.md), or to get
access to [environment-scoped variables](#scoping-environments-with-specs). In these cases,
you can use the `action: prepare` keyword to ensure deployments aren't created,
and no builds are canceled:
To use an environment without creating a new deployment, and without
cancelling outdated deployments, append the keyword `action: prepare` to your
job:
```yaml
build:
......@@ -522,6 +520,9 @@ build:
url: https://staging.example.com
```
This gives you access to [environment-scoped variables](#scoping-environments-with-specs),
and can be used to [protect builds from unauthorized access](protected_environments.md).
### Group similar environments
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/7015) in GitLab 8.14.
......
......@@ -2579,9 +2579,9 @@ Use the `action` keyword to specify jobs that prepare, start, or stop environmen
| **Value** | **Description** |
|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| start | Default value. Indicates that job starts the environment. The deployment is created after the job starts. |
| prepare | Indicates that job is only preparing the environment. Does not affect deployments. [Read more about environments](../environments/index.md#prepare-an-environment) |
| stop | Indicates that job stops deployment. See the example below. |
| `start` | Default value. Indicates that job starts the environment. The deployment is created after the job starts. |
| `prepare` | Indicates that the job is only preparing the environment. It does not trigger deployments. [Read more about preparing environments](../environments/index.md#prepare-an-environment-without-creating-a-deployment). |
| `stop` | Indicates that job stops deployment. See the example below. |
Take for instance:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment