Commit e129f66d authored by Kamil Trzcinski's avatar Kamil Trzcinski

Add gitlab-ci.yml documentation for environments

parent 3ade8260
...@@ -28,6 +28,7 @@ If you want a quick introduction to GitLab CI, follow our ...@@ -28,6 +28,7 @@ If you want a quick introduction to GitLab CI, follow our
- [only and except](#only-and-except) - [only and except](#only-and-except)
- [tags](#tags) - [tags](#tags)
- [when](#when) - [when](#when)
- [environment](#environment)
- [artifacts](#artifacts) - [artifacts](#artifacts)
- [artifacts:name](#artifacts-name) - [artifacts:name](#artifacts-name)
- [artifacts:when](#artifacts-when) - [artifacts:when](#artifacts-when)
...@@ -353,6 +354,7 @@ job_name: ...@@ -353,6 +354,7 @@ job_name:
| cache | no | Define list of files that should be cached between subsequent runs | | cache | no | Define list of files that should be cached between subsequent runs |
| before_script | no | Override a set of commands that are executed before build | | before_script | no | Override a set of commands that are executed before build |
| after_script | no | Override a set of commands that are executed after build | | after_script | no | Override a set of commands that are executed after build |
| environment | no | Defines a name of environment to which deployment is done by this build |
### script ### script
...@@ -524,6 +526,31 @@ The above script will: ...@@ -524,6 +526,31 @@ The above script will:
1. Execute `cleanup_build_job` only when `build_job` fails 1. Execute `cleanup_build_job` only when `build_job` fails
2. Always execute `cleanup_job` as the last step in pipeline. 2. Always execute `cleanup_job` as the last step in pipeline.
### environment
>**Note:**
Introduced in GitLab v8.9.0.
`environment` is used to define that job does deployment to specific environment.
This allows to easily track all deployments to your environments straight from GitLab.
If `environment` is specified and no environment under that name does exist a new one will be created automatically.
The `environment` name must contain only letters, digits, '-' and '_'.
---
**Example configurations**
```
deploy to production:
stage: deploy
script: git push production HEAD:master
environment: production
```
The `deploy to production` job will be marked as doing deployment to `production` environment.
### artifacts ### artifacts
>**Notes:** >**Notes:**
......
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