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
Léo-Paul Géneau
gitlab-ce
Commits
5c2ce44b
Commit
5c2ce44b
authored
May 31, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose pipeline stage seeds from pipeline instance
parent
c72e21fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+7
-5
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+11
-0
No files found.
app/models/ci/pipeline.rb
View file @
5c2ce44b
...
...
@@ -296,11 +296,13 @@ module Ci
end
def
stage_seeds
return
[]
unless
config_processor
return
unless
config_processor
seeds_scope
=
{
ref:
ref
,
tag:
tag?
,
trigger:
trigger_requests
.
first
}
config_processor
.
stage_seeds
(
ref:
ref
,
tag:
tag?
,
trigger:
trigger_requests
.
first
)
config_processor
.
stage_seeds
(
seeds_scope
).
tap
do
|
seeds
|
seeds
.
pipeline
=
self
end
end
def
has_stages?
...
...
@@ -312,7 +314,7 @@ module Ci
end
def
config_processor
return
nil
unless
ci_yaml_file
return
unless
ci_yaml_file
return
@config_processor
if
defined?
(
@config_processor
)
@config_processor
||=
begin
...
...
spec/models/ci/pipeline_spec.rb
View file @
5c2ce44b
...
...
@@ -202,6 +202,17 @@ describe Ci::Pipeline, models: true do
status:
'success'
)
end
describe
'#stage_seeds'
do
let
(
:pipeline
)
do
create
(
:ci_pipeline
,
config:
{
rspec:
{
script:
'rake'
}
})
end
it
'returns preseeded stage seeds object'
do
expect
(
pipeline
.
stage_seeds
).
to
be_a
Gitlab
::
Ci
::
Stage
::
Seeds
expect
(
pipeline
.
stage_seeds
.
stages
).
to
all
(
include
(
pipeline:
pipeline
))
end
end
describe
'#stages'
do
subject
{
pipeline
.
stages
}
...
...
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