Commit 622b405e authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Merge branch 'bcarranza-deployment-jobs-docs' into 'master'

Add deployment jobs section to the jobs docs

See merge request gitlab-org/gitlab!64832
parents cd5e6ba4 23f68d57
......@@ -259,3 +259,27 @@ job1:
- echo 'this line should be hidden automatically after loading the job log'
- echo -e "\e[0Ksection_end:`date +%s`:my_first_section\r\e[0K"
```
## Deployment jobs
Deployment jobs are a specific kind of CI job in that they deploy code to
[environments](../environments/index.md). A deployment job is any job that
uses the `environment` keyword and the [`start` environment `action`](../yaml/README.md#environmentaction).
Deployment jobs do not need to be in the `deploy` stage. The following `deploy me`
job is an example of a deployment job. `action: start` is the default behavior and
is defined for the sake of the example, but you can omit it:
```yaml
deploy me:
script:
- deploy-to-cats.sh
environment:
name: production
url: https://cats.example.com
action: start
```
The behavior of deployment jobs can be controlled with
[deployment safety](../environments/deployment_safety.md) settings like
[skipping outdated deployment jobs](../environments/deployment_safety.md#prevent-deployments-during-deploy-freeze-windows)
and [ensuring only one deployment job runs at a time](../environments/deployment_safety.md#ensure-only-one-deployment-job-runs-at-a-time).
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