Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
317477fc
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
lib/gitlab/ci/pipeline/chain/build.rb
lib/gitlab/ci/pipeline/chain/build.rb
+2
-1
lib/gitlab/ci/pipeline/chain/command.rb
lib/gitlab/ci/pipeline/chain/command.rb
+1
-1
spec/lib/gitlab/ci/pipeline/chain/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
...
@@ -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
...
...
lib/gitlab/ci/pipeline/chain/command.rb
View file @
317477fc
...
@@ -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
...
...
spec/lib/gitlab/ci/pipeline/chain/build_spec.rb
View file @
317477fc
...
@@ -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
...
...
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