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
...
@@ -34,34 +34,39 @@ class Gitlab::Seeder::Builds
end
end
end
end
private
def
pipelines
def
pipelines
master_pipelines
+
merge_request_pipelines
create_master_pipelines
+
create_
merge_request_pipelines
end
end
def
master_pipelines
def
create_master_pipelines
create_pipelines_for
(
@project
,
'master'
)
@project
.
repository
.
commits
(
'master'
,
limit:
5
).
map
do
|
commit
|
create_pipeline!
(
@project
,
'master'
,
commit
)
end
rescue
rescue
[]
[]
end
end
def
merge_request_pipelines
def
create_merge_request_pipelines
@project
.
merge_requests
.
last
(
5
).
map
do
|
merge_request
|
pipelines
=
@project
.
merge_requests
.
first
(
5
).
map
do
|
merge_request
|
create_pipelines
(
merge_request
.
source_project
,
merge_request
.
source_branch
,
merge_request
.
commits
.
last
(
5
))
project
=
merge_request
.
source_project
end
.
flatten
branch
=
merge_request
.
source_branch
merge_request
.
commits
.
last
(
5
).
map
do
|
commit
|
create_pipeline!
(
project
,
branch
,
commit
)
end
end
pipelines
.
flatten
rescue
rescue
[]
[]
end
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
)
def
create_pipeline!
(
project
,
ref
,
commit
)
commits
.
map
do
|
commit
|
project
.
pipelines
.
create
(
sha:
commit
.
id
,
ref:
ref
)
project
.
pipelines
.
create
(
sha:
commit
.
id
,
ref:
ref
)
end
end
end
def
build_create!
(
pipeline
,
opts
=
{})
def
build_create!
(
pipeline
,
opts
=
{})
attributes
=
build_attributes_for
(
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