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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
d3af645e
Commit
d3af645e
authored
Aug 17, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor pipeline fixtures for dev env a little
parent
ac73de50
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
15 deletions
+20
-15
db/fixtures/development/14_builds.rb
db/fixtures/development/14_builds.rb
+20
-15
No files found.
db/fixtures/development/14_builds.rb
View file @
d3af645e
...
...
@@ -34,34 +34,39 @@ class Gitlab::Seeder::Builds
end
end
private
def
pipelines
master_pipelines
+
merge_request_pipelines
create_master_pipelines
+
create_
merge_request_pipelines
end
def
master_pipelines
create_pipelines_for
(
@project
,
'master'
)
def
create_master_pipelines
@project
.
repository
.
commits
(
'master'
,
limit:
5
).
map
do
|
commit
|
create_pipeline!
(
@project
,
'master'
,
commit
)
end
rescue
[]
end
def
merge_request_pipelines
@project
.
merge_requests
.
last
(
5
).
map
do
|
merge_request
|
create_pipelines
(
merge_request
.
source_project
,
merge_request
.
source_branch
,
merge_request
.
commits
.
last
(
5
))
end
.
flatten
def
create_merge_request_pipelines
pipelines
=
@project
.
merge_requests
.
first
(
5
).
map
do
|
merge_request
|
project
=
merge_request
.
source_project
branch
=
merge_request
.
source_branch
merge_request
.
commits
.
last
(
5
).
map
do
|
commit
|
create_pipeline!
(
project
,
branch
,
commit
)
end
end
pipelines
.
flatten
rescue
[]
end
def
create_pipelines_for
(
project
,
ref
)
commits
=
project
.
repository
.
commits
(
ref
,
limit:
5
)
create_pipelines
(
project
,
ref
,
commits
)
end
def
create_pipelines
(
project
,
ref
,
commits
)
commits
.
map
do
|
commit
|
def
create_pipeline!
(
project
,
ref
,
commit
)
project
.
pipelines
.
create
(
sha:
commit
.
id
,
ref:
ref
)
end
end
def
build_create!
(
pipeline
,
opts
=
{})
attributes
=
build_attributes_for
(
pipeline
,
opts
)
...
...
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