summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-02-23 14:59:34 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-02-24 15:26:53 +0100
commit7bb0c79b8e0c3b28d79a9471ed516651abfa1a6c (patch)
tree8319d31910210633b416801fa0abf92da3cf589d
parentda6157a544a01faf5aa99537c8bb35d3ef2a3a6f (diff)
downloadgitlab-ce-7bb0c79b8e0c3b28d79a9471ed516651abfa1a6c.tar.gz
Fix pipeline variables when pipeline has no schedule
-rw-r--r--app/models/ci/pipeline.rb10
-rw-r--r--app/models/project.rb2
2 files changed, 8 insertions, 4 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index d5424dee798..85024408cf2 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -473,7 +473,7 @@ module Ci
end
def predefined_variables
- variables = [
+ predefined = [
{ key: 'CI', value: 'true', public: true },
{ key: 'GITLAB_CI', value: 'true', public: true },
{ key: 'GITLAB_FEATURES', value: project.namespace.features.join(','), public: true },
@@ -485,9 +485,11 @@ module Ci
{ key: 'CI_PIPELINE_SOURCE', value: source.to_s, public: true }
]
- variables += project.predefined_variables
- variables += variables.map(&:to_runner_variable)
- variables += pipeline_schedule.job_variables if pipeline_schedule
+ predefined += project.predefined_variables
+ predefined += pipeline_schedule.job_variables if pipeline_schedule
+ predefined += self.variables.map(&:to_runner_variable)
+
+ predefined
end
def queued_duration
diff --git a/app/models/project.rb b/app/models/project.rb
index 995575718f8..f7c41ab5fa4 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1566,6 +1566,8 @@ class Project < ActiveRecord::Base
variables += container_registry_variables
variables += auto_devops_variables
+
+ variables
end
def container_registry_variables