diff options
Diffstat (limited to 'doc/ci/yaml/README.md')
-rw-r--r-- | doc/ci/yaml/README.md | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index 5f88974d360..5e8d888e555 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -690,18 +690,12 @@ The `stop_review_app` job is **required** to have the following keywords defined #### dynamic environments > [Introduced][ce-6323] in GitLab 8.12 and GitLab Runner 1.6. + `$CI_BUILD_REF_SLUG` was [introduced][ce-8072] in GitLab 8.15. `environment` can also represent a configuration hash with `name` and `url`. These parameters can use any of the defined [CI variables](#variables) (including predefined, secure variables and `.gitlab-ci.yml` variables). ->**Note:** -Be aware than if the branch name contains special characters and you use the -`$CI_BUILD_REF_NAME` variable to dynamically create environments, there might -be complications during deployment. Follow the -[issue 22849](https://gitlab.com/gitlab-org/gitlab-ce/issues/22849) for more -information. - For example: ``` @@ -710,7 +704,7 @@ deploy as review app: script: make deploy environment: name: review-apps/$CI_BUILD_REF_NAME - url: https://$CI_BUILD_REF_NAME.review.example.com/ + url: https://$CI_BUILD_REF_SLUG.review.example.com/ ``` The `deploy as review app` job will be marked as deployment to dynamically @@ -726,6 +720,10 @@ The common use case is to create dynamic environments for branches and use them as Review Apps. You can see a simple example using Review Apps at https://gitlab.com/gitlab-examples/review-apps-nginx/. +`$CI_BUILD_REF_SLUG` is another environment variable set by the runner, based on +`$CI_BUILD_REF_NAME` but lower-cased, and with some characters replaced with +`-`, making it suitable for use in URLs and domain names. + ### artifacts >**Notes:** @@ -1245,4 +1243,5 @@ CI with various languages. [ce-6323]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6323 [environment]: ../environments.md [ce-6669]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6669 +[ce-8072]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/xxxx [variables]: ../variables/README.md |