BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
317477fc
Unverified
Commit
317477fc
authored
Apr 18, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend Gitlab::Ci::Pipeline::Chain::Command with variables_attributes
parent
80cc9df9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
build.rb
lib/gitlab/ci/pipeline/chain/build.rb
+2
-1
command.rb
lib/gitlab/ci/pipeline/chain/command.rb
+1
-1
build_spec.rb
spec/lib/gitlab/ci/pipeline/chain/build_spec.rb
+7
-1
No files found.
lib/gitlab/ci/pipeline/chain/build.rb
View file @
317477fc
...
...
@@ -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
...
...
lib/gitlab/ci/pipeline/chain/command.rb
View file @
317477fc
...
...
@@ -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
...
...
spec/lib/gitlab/ci/pipeline/chain/build_spec.rb
View file @
317477fc
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment