From 223041fa1bba534d613489f41d6143f1785fd0b4 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Sun, 18 Sep 2016 20:31:00 +0200 Subject: [PATCH] Fix environments handling --- doc/ci/yaml/README.md | 3 +-- lib/gitlab/regex.rb | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index f65340f190e..16868554c1f 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -547,7 +547,7 @@ GitLab. If `environment` is specified and no environment under that name exists, a new one will be created automatically. -The `environment` name must be a valid [Git reference name][gitref]. Common +The `environment` name must contain only letters, digits, '-', '_', '/', '$', '{', '}' and spaces. Common names are `qa`, `staging`, and `production`, but you can use whatever name works with your workflow. @@ -1083,5 +1083,4 @@ CI with various languages. [examples]: ../examples/README.md [ce-6323]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6323 -[gitref]: https://git-scm.com/docs/git-check-ref-format [environment]: ../environments.md diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb index d1a3e54ccd7..4efd9ae2c1e 100644 --- a/lib/gitlab/regex.rb +++ b/lib/gitlab/regex.rb @@ -96,11 +96,11 @@ module Gitlab end def environment_name_regex - git_reference_regex + @environment_name_regex ||= /\A[a-zA-Z0-9_\\\/\${} -]+\z/.freeze end def environment_name_regex_message - "be a valid git reference name" + "can contain only letters, digits, '-', '_', '/', '$', '{', '}' and spaces" end end end