Commit 317477fc authored by Matija Čupić's avatar Matija Čupić

Extend Gitlab::Ci::Pipeline::Chain::Command with variables_attributes

parent 80cc9df9
...@@ -14,7 +14,8 @@ module Gitlab ...@@ -14,7 +14,8 @@ module Gitlab
trigger_requests: Array(@command.trigger_request), trigger_requests: Array(@command.trigger_request),
user: @command.current_user, user: @command.current_user,
pipeline_schedule: @command.schedule, pipeline_schedule: @command.schedule,
protected: @command.protected_ref? protected: @command.protected_ref?,
variables_attributes: Array(@command.variables_attributes)
) )
@pipeline.set_config_source @pipeline.set_config_source
......
...@@ -7,7 +7,7 @@ module Gitlab # rubocop:disable Naming/FileName ...@@ -7,7 +7,7 @@ module Gitlab # rubocop:disable Naming/FileName
:origin_ref, :checkout_sha, :after_sha, :before_sha, :origin_ref, :checkout_sha, :after_sha, :before_sha,
:trigger_request, :schedule, :trigger_request, :schedule,
:ignore_skip_ci, :save_incompleted, :ignore_skip_ci, :save_incompleted,
:seeds_block :seeds_block, :variables_attributes
) do ) do
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
......
...@@ -5,6 +5,10 @@ describe Gitlab::Ci::Pipeline::Chain::Build do ...@@ -5,6 +5,10 @@ describe Gitlab::Ci::Pipeline::Chain::Build do
set(:user) { create(:user) } set(:user) { create(:user) }
let(:pipeline) { Ci::Pipeline.new } let(:pipeline) { Ci::Pipeline.new }
let(:variables_attributes) do
[{ key: 'first', secret_value: 'world' },
{ key: 'second', secret_value: 'second_world' }]
end
let(:command) do let(:command) do
Gitlab::Ci::Pipeline::Chain::Command.new( Gitlab::Ci::Pipeline::Chain::Command.new(
source: :push, source: :push,
...@@ -15,7 +19,8 @@ describe Gitlab::Ci::Pipeline::Chain::Build do ...@@ -15,7 +19,8 @@ describe Gitlab::Ci::Pipeline::Chain::Build do
trigger_request: nil, trigger_request: nil,
schedule: nil, schedule: nil,
project: project, project: project,
current_user: user) current_user: user,
variables_attributes: variables_attributes)
end end
let(:step) { described_class.new(pipeline, command) } let(:step) { described_class.new(pipeline, command) }
...@@ -39,6 +44,7 @@ describe Gitlab::Ci::Pipeline::Chain::Build do ...@@ -39,6 +44,7 @@ describe Gitlab::Ci::Pipeline::Chain::Build do
expect(pipeline.tag).to be false expect(pipeline.tag).to be false
expect(pipeline.user).to eq user expect(pipeline.user).to eq user
expect(pipeline.project).to eq project expect(pipeline.project).to eq project
expect(pipeline.variables.size).to eq variables_attributes.count
end end
it 'sets a valid config source' do it 'sets a valid config source' do
......
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