Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-03-14 13:04:42 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-03-14 13:04:42 +0300
commit1d57db0d8d9ed0515fb1839e963550a60d86cb70 (patch)
tree010180a48ae2a737614beec7d42448afa420000e /app/models/project.rb
parente7e06566e150af8ecc54c67bd6f5cd5b86c99628 (diff)
Improve predefined variables collection methods
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb21
1 files changed, 10 insertions, 11 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 87d228997be..73f3794867b 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1574,17 +1574,16 @@ class Project < ActiveRecord::Base
def predefined_variables
visibility = Gitlab::VisibilityLevel.string_level(visibility_level)
- Gitlab::Ci::Variables::Collection.new.tap do |variables|
- variables.append(key: 'CI_PROJECT_ID', value: id.to_s)
- variables.append(key: 'CI_PROJECT_NAME', value: path)
- variables.append(key: 'CI_PROJECT_PATH', value: full_path)
- variables.append(key: 'CI_PROJECT_PATH_SLUG', value: full_path_slug)
- variables.append(key: 'CI_PROJECT_NAMESPACE', value: namespace.full_path)
- variables.append(key: 'CI_PROJECT_URL', value: web_url)
- variables.append(key: 'CI_PROJECT_VISIBILITY', value: visibility)
- variables.concat(container_registry_variables)
- variables.concat(auto_devops_variables)
- end
+ Gitlab::Ci::Variables::Collection.new
+ .append(key: 'CI_PROJECT_ID', value: id.to_s)
+ .append(key: 'CI_PROJECT_NAME', value: path)
+ .append(key: 'CI_PROJECT_PATH', value: full_path)
+ .append(key: 'CI_PROJECT_PATH_SLUG', value: full_path_slug)
+ .append(key: 'CI_PROJECT_NAMESPACE', value: namespace.full_path)
+ .append(key: 'CI_PROJECT_URL', value: web_url)
+ .append(key: 'CI_PROJECT_VISIBILITY', value: visibility)
+ .concat(container_registry_variables)
+ .concat(auto_devops_variables)
end
def container_registry_variables