Commit 7bb0c79b authored by Grzegorz Bizon's avatar Grzegorz Bizon

Fix pipeline variables when pipeline has no schedule

parent da6157a5
...@@ -473,7 +473,7 @@ module Ci ...@@ -473,7 +473,7 @@ module Ci
end end
def predefined_variables def predefined_variables
variables = [ predefined = [
{ key: 'CI', value: 'true', public: true }, { key: 'CI', value: 'true', public: true },
{ key: 'GITLAB_CI', value: 'true', public: true }, { key: 'GITLAB_CI', value: 'true', public: true },
{ key: 'GITLAB_FEATURES', value: project.namespace.features.join(','), public: true }, { key: 'GITLAB_FEATURES', value: project.namespace.features.join(','), public: true },
...@@ -485,9 +485,11 @@ module Ci ...@@ -485,9 +485,11 @@ module Ci
{ key: 'CI_PIPELINE_SOURCE', value: source.to_s, public: true } { key: 'CI_PIPELINE_SOURCE', value: source.to_s, public: true }
] ]
variables += project.predefined_variables predefined += project.predefined_variables
variables += variables.map(&:to_runner_variable) predefined += pipeline_schedule.job_variables if pipeline_schedule
variables += pipeline_schedule.job_variables if pipeline_schedule predefined += self.variables.map(&:to_runner_variable)
predefined
end end
def queued_duration def queued_duration
......
...@@ -1566,6 +1566,8 @@ class Project < ActiveRecord::Base ...@@ -1566,6 +1566,8 @@ class Project < ActiveRecord::Base
variables += container_registry_variables variables += container_registry_variables
variables += auto_devops_variables variables += auto_devops_variables
variables
end end
def container_registry_variables def container_registry_variables
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment