summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-09-06 18:57:07 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2017-09-06 18:57:07 +0200
commit82ed2a0909823807f3ece2cb29bfc501293361a0 (patch)
tree697cee39fdf2ef7ec353d32016f96052cb6c6459 /app/models/project.rb
parent8189347b4986e2e44b30d04bf9e83c11e76feef8 (diff)
downloadgitlab-ce-82ed2a0909823807f3ece2cb29bfc501293361a0.tar.gz
Improve config source handling code
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 9c1a2a15d2a..f8cc27d5569 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1390,7 +1390,7 @@ class Project < ActiveRecord::Base
end
def predefined_variables
- variables = [
+ [
{ key: 'CI_PROJECT_ID', value: id.to_s, public: true },
{ key: 'CI_PROJECT_NAME', value: path, public: true },
{ key: 'CI_PROJECT_PATH', value: full_path, public: true },
@@ -1398,12 +1398,6 @@ class Project < ActiveRecord::Base
{ key: 'CI_PROJECT_NAMESPACE', value: namespace.full_path, public: true },
{ key: 'CI_PROJECT_URL', value: web_url, public: true }
]
-
- if auto_devops_enabled? && auto_devops&.domain
- variables << { key: 'AUTO_DEVOPS_DOMAIN', value: auto_devops.domain, public: true }
- end
-
- variables
end
def container_registry_variables
@@ -1440,6 +1434,12 @@ class Project < ActiveRecord::Base
deployment_service.predefined_variables
end
+ def auto_devops_variables
+ return [] unless auto_devops_enabled?
+
+ auto_devops&.variables || []
+ end
+
def append_or_update_attribute(name, value)
old_values = public_send(name.to_s) # rubocop:disable GitlabSecurity/PublicSend