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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
a85e11fa
Commit
a85e11fa
authored
Nov 13, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved seeds for development env
parent
f0a6fbaa
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
107 additions
and
79 deletions
+107
-79
db/fixtures/development/002_project.rb
db/fixtures/development/002_project.rb
+3
-3
db/fixtures/development/004_teams.rb
db/fixtures/development/004_teams.rb
+6
-0
db/fixtures/development/006_wall.rb
db/fixtures/development/006_wall.rb
+19
-40
db/fixtures/development/007_issues.rb
db/fixtures/development/007_issues.rb
+20
-17
db/fixtures/development/008_merge_requests.rb
db/fixtures/development/008_merge_requests.rb
+22
-19
db/fixtures/development/009_source_code.rb
db/fixtures/development/009_source_code.rb
+27
-0
lib/gitlab/seeder.rb
lib/gitlab/seeder.rb
+10
-0
No files found.
db/fixtures/development/002_project.rb
View file @
a85e11fa
Project
.
seed
(
:id
,
[
Project
.
seed
(
:id
,
[
{
:id
=>
1
,
:name
=>
"Rubinius"
,
:path
=>
"rubinius"
,
:code
=>
"rubinius"
,
:owner_id
=>
1
},
{
id:
1
,
name:
"Underscore.js"
,
path:
"underscore"
,
code:
"underscore"
,
owner_id:
1
},
{
:id
=>
2
,
:name
=>
"Diaspora"
,
:path
=>
"diaspora"
,
:code
=>
"diaspora"
,
:owner_id
=>
1
},
{
id:
2
,
name:
"Diaspora"
,
path:
"diaspora"
,
code:
"diaspora"
,
owner_id:
1
},
{
:id
=>
3
,
:name
=>
"Ruby on Rails"
,
:path
=>
"ruby_on_rails"
,
:code
=>
"ruby_on_rails"
,
:owner_id
=>
1
}
{
id:
3
,
name:
"Ruby on Rails"
,
path:
"rails"
,
code:
"rails"
,
owner_id:
1
}
])
])
db/fixtures/development/004_teams.rb
View file @
a85e11fa
UsersProject
.
skip_callback
(
:save
,
:after
,
:update_repository
)
UsersProject
.
seed
(
:id
,
[
UsersProject
.
seed
(
:id
,
[
{
:id
=>
1
,
:project_id
=>
1
,
:user_id
=>
1
,
:project_access
=>
UsersProject
::
MASTER
},
{
:id
=>
1
,
:project_id
=>
1
,
:user_id
=>
1
,
:project_access
=>
UsersProject
::
MASTER
},
{
:id
=>
2
,
:project_id
=>
1
,
:user_id
=>
2
,
:project_access
=>
UsersProject
::
REPORTER
},
{
:id
=>
2
,
:project_id
=>
1
,
:user_id
=>
2
,
:project_access
=>
UsersProject
::
REPORTER
},
...
@@ -18,4 +20,8 @@ UsersProject.seed(:id, [
...
@@ -18,4 +20,8 @@ UsersProject.seed(:id, [
{
:id
=>
16
,
:project_id
=>
3
,
:user_id
=>
5
,
:project_access
=>
UsersProject
::
MASTER
}
{
:id
=>
16
,
:project_id
=>
3
,
:user_id
=>
5
,
:project_access
=>
UsersProject
::
MASTER
}
])
])
UsersProject
.
set_callback
(
:save
,
:after
,
:update_repository
)
puts
"
\n
Rebuild gitolite
\n
"
.
yellow
Project
.
all
.
each
(
&
:update_repository
)
puts
"OK"
.
green
db/fixtures/development/006_wall.rb
View file @
a85e11fa
Note
.
seed
(
:id
,
[
Gitlab
::
Seeder
.
quiet
do
{
:id
=>
1
,
:project_id
=>
1
,
:author_id
=>
1
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
(
1
..
300
).
each
do
|
i
|
{
:id
=>
2
,
:project_id
=>
1
,
:author_id
=>
2
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
# Random Project
{
:id
=>
3
,
:project_id
=>
1
,
:author_id
=>
3
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
project_id
=
rand
(
2
)
+
1
{
:id
=>
4
,
:project_id
=>
1
,
:author_id
=>
4
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
project
=
Project
.
find
(
project_id
)
{
:id
=>
5
,
:project_id
=>
1
,
:author_id
=>
5
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
# Random user
{
:id
=>
6
,
:project_id
=>
2
,
:author_id
=>
1
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
user
=
project
.
users
.
sample
{
:id
=>
7
,
:project_id
=>
2
,
:author_id
=>
2
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
user_id
=
user
.
id
{
:id
=>
8
,
:project_id
=>
2
,
:author_id
=>
3
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
9
,
:project_id
=>
2
,
:author_id
=>
4
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
Note
.
seed
(
:id
,
[{
{
:id
=>
11
,
:project_id
=>
2
,
:author_id
=>
5
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
id:
i
,
project_id:
project_id
,
{
:id
=>
12
,
:project_id
=>
3
,
:author_id
=>
1
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)},
author_id:
user_id
,
{
:id
=>
13
,
:project_id
=>
3
,
:author_id
=>
2
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)},
note:
Faker
::
Lorem
.
sentence
(
6
)
{
:id
=>
14
,
:project_id
=>
3
,
:author_id
=>
3
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)},
}])
{
:id
=>
15
,
:project_id
=>
3
,
:author_id
=>
4
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)},
print
(
'.'
)
{
:id
=>
16
,
:project_id
=>
3
,
:author_id
=>
5
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)},
end
end
{
:id
=>
21
,
:project_id
=>
1
,
:author_id
=>
1
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
22
,
:project_id
=>
1
,
:author_id
=>
2
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
23
,
:project_id
=>
1
,
:author_id
=>
3
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
24
,
:project_id
=>
1
,
:author_id
=>
4
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
25
,
:project_id
=>
1
,
:author_id
=>
5
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
26
,
:project_id
=>
2
,
:author_id
=>
1
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
27
,
:project_id
=>
2
,
:author_id
=>
2
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
28
,
:project_id
=>
2
,
:author_id
=>
3
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
29
,
:project_id
=>
2
,
:author_id
=>
4
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
30
,
:project_id
=>
2
,
:author_id
=>
5
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
32
,
:project_id
=>
3
,
:author_id
=>
1
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)},
{
:id
=>
33
,
:project_id
=>
3
,
:author_id
=>
2
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)},
{
:id
=>
34
,
:project_id
=>
3
,
:author_id
=>
3
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)},
{
:id
=>
35
,
:project_id
=>
3
,
:author_id
=>
4
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)},
{
:id
=>
36
,
:project_id
=>
3
,
:author_id
=>
5
,
:note
=>
Faker
::
Lorem
.
sentence
(
6
)}
])
db/fixtures/development/007_issues.rb
View file @
a85e11fa
(
1
..
300
).
each
do
|
i
|
Gitlab
::
Seeder
.
quiet
do
(
1
..
300
).
each
do
|
i
|
# Random Project
# Random Project
project_id
=
rand
(
2
)
+
1
project_id
=
rand
(
2
)
+
1
project
=
Project
.
find
(
project_id
)
project
=
Project
.
find
(
project_id
)
...
@@ -17,4 +18,6 @@
...
@@ -17,4 +18,6 @@
milestone:
project
.
milestones
.
sample
,
milestone:
project
.
milestones
.
sample
,
title:
Faker
::
Lorem
.
sentence
(
6
)
title:
Faker
::
Lorem
.
sentence
(
6
)
}])
}])
print
(
'.'
)
end
end
end
db/fixtures/development/008_merge_requests.rb
View file @
a85e11fa
(
1
..
300
).
each
do
|
i
|
Gitlab
::
Seeder
.
quiet
do
(
1
..
300
).
each
do
|
i
|
# Random Project
# Random Project
project_id
=
rand
(
2
)
+
1
project_id
=
rand
(
2
)
+
1
project
=
Project
.
find
(
project_id
)
project
=
Project
.
find
(
project_id
)
...
@@ -19,4 +20,6 @@
...
@@ -19,4 +20,6 @@
milestone:
project
.
milestones
.
sample
,
milestone:
project
.
milestones
.
sample
,
title:
Faker
::
Lorem
.
sentence
(
6
)
title:
Faker
::
Lorem
.
sentence
(
6
)
}])
}])
print
(
'.'
)
end
end
end
db/fixtures/development/009_source_code.rb
0 → 100644
View file @
a85e11fa
root
=
Gitlab
.
config
.
git_base_path
projects
=
[
{
path:
'underscore.git'
,
git:
'https://github.com/documentcloud/underscore.git'
},
{
path:
'diaspora.git'
,
git:
'https://github.com/diaspora/diaspora.git'
},
{
path:
'rails.git'
,
git:
'https://github.com/rails/rails.git'
},
]
projects
.
each
do
|
project
|
project_path
=
File
.
join
(
root
,
project
[
:path
])
next
if
File
.
exists?
(
project_path
)
cmds
=
[
"cd
#{
root
}
&& sudo -u git -H git clone --bare
#{
project
[
:git
]
}
"
,
"sudo cp ./lib/hooks/post-receive
#{
project_path
}
/hooks/post-receive"
,
"sudo chown git:git
#{
project_path
}
/hooks/post-receive"
]
cmds
.
each
do
|
cmd
|
puts
cmd
.
yellow
`
#{
cmd
}
`
end
end
puts
"OK"
.
green
lib/gitlab/seeder.rb
0 → 100644
View file @
a85e11fa
module
Gitlab
class
Seeder
def
self
.
quiet
SeedFu
.
quiet
=
true
yield
SeedFu
.
quiet
=
false
puts
"
\n
OK"
.
green
end
end
end
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