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
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
......
......@@ -1566,6 +1566,8 @@ class Project < ActiveRecord::Base
variables += container_registry_variables
variables += auto_devops_variables
variables
end
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