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