Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
f47ba909
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f47ba909
编写于
6月 20, 2013
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix seeds. More projects for dev seeds
上级
86d9ed9a
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
63 addition
and
60 deletion
+63
-60
db/fixtures/development/01_admin.rb
db/fixtures/development/01_admin.rb
+1
-0
db/fixtures/development/02_source_code.rb
db/fixtures/development/02_source_code.rb
+0
-29
db/fixtures/development/03_group.rb
db/fixtures/development/03_group.rb
+0
-5
db/fixtures/development/04_project.rb
db/fixtures/development/04_project.rb
+45
-16
db/fixtures/development/05_users.rb
db/fixtures/development/05_users.rb
+1
-1
db/fixtures/development/06_teams.rb
db/fixtures/development/06_teams.rb
+16
-7
db/fixtures/development/09_issues.rb
db/fixtures/development/09_issues.rb
+0
-1
db/fixtures/development/10_merge_requests.rb
db/fixtures/development/10_merge_requests.rb
+0
-1
未找到文件。
db/fixtures/development/01_admin.rb
浏览文件 @
f47ba909
...
...
@@ -7,5 +7,6 @@ User.seed(:id, [
password:
"5iveL!fe"
,
password_confirmation:
"5iveL!fe"
,
admin:
true
,
projects_limit:
100
,
}
])
db/fixtures/development/02_source_code.rb
已删除
100644 → 0
浏览文件 @
86d9ed9a
gitlab_shell_path
=
File
.
expand_path
(
"~
#{
Gitlab
.
config
.
gitlab_shell
.
ssh_user
}
"
)
root
=
Gitlab
.
config
.
gitlab_shell
.
repos_path
projects
=
[
{
path:
'underscore.git'
,
git:
'https://github.com/documentcloud/underscore.git'
},
{
path:
'diaspora.git'
,
git:
'https://github.com/diaspora/diaspora.git'
},
{
path:
'brightbox/brightbox-cli.git'
,
git:
'https://github.com/brightbox/brightbox-cli.git'
},
{
path:
'brightbox/puppet.git'
,
git:
'https://github.com/brightbox/puppet.git'
},
{
path:
'gitlab/gitlabhq.git'
,
git:
'https://github.com/gitlabhq/gitlabhq.git'
},
{
path:
'gitlab/gitlab-ci.git'
,
git:
'https://github.com/gitlabhq/gitlab-ci.git'
},
{
path:
'gitlab/gitlab-recipes.git'
,
git:
'https://github.com/gitlabhq/gitlab-recipes.git'
},
]
projects
.
each
do
|
project
|
project_path
=
File
.
join
(
root
,
project
[
:path
])
if
File
.
exists?
(
project_path
)
print
'-'
next
end
if
system
(
"
#{
gitlab_shell_path
}
/gitlab-shell/bin/gitlab-projects import-project
#{
project
[
:path
]
}
#{
project
[
:git
]
}
"
)
print
'.'
else
print
'F'
end
end
puts
"OK"
.
green
db/fixtures/development/03_group.rb
已删除
100644 → 0
浏览文件 @
86d9ed9a
Group
.
seed
(
:id
,
[
{
id:
99
,
name:
"GitLab"
,
path:
'gitlab'
,
owner_id:
1
},
{
id:
100
,
name:
"Brightbox"
,
path:
'brightbox'
,
owner_id:
1
},
{
id:
101
,
name:
"KDE"
,
path:
'kde'
,
owner_id:
1
},
])
db/fixtures/development/04_project.rb
浏览文件 @
f47ba909
Project
.
seed
(
:id
,
[
project_urls
=
[
'https://github.com/documentcloud/underscore.git'
,
'https://github.com/diaspora/diaspora.git'
,
'https://github.com/diaspora/diaspora-project-site.git'
,
'https://github.com/diaspora/diaspora-client.git'
,
'https://github.com/brightbox/brightbox-cli.git'
,
'https://github.com/brightbox/puppet.git'
,
'https://github.com/gitlabhq/gitlabhq.git'
,
'https://github.com/gitlabhq/gitlab-ci.git'
,
'https://github.com/gitlabhq/gitlab-recipes.git'
,
'https://github.com/gitlabhq/gitlab-shell.git'
,
'https://github.com/gitlabhq/grack.git'
,
'https://github.com/twitter/flight.git'
,
'https://github.com/twitter/typeahead.js.git'
,
'https://github.com/h5bp/html5-boilerplate.git'
,
'https://github.com/h5bp/mobile-boilerplate.git'
,
]
# Global
{
id:
1
,
name:
"Underscore.js"
,
path:
"underscore"
,
creator_id:
1
},
{
id:
2
,
name:
"Diaspora"
,
path:
"diaspora"
,
creator_id:
1
},
project_urls
.
each_with_index
do
|
url
,
i
|
group_path
,
project_path
=
url
.
split
(
'/'
)[
-
2
..-
1
]
# Brightbox
{
id:
3
,
namespace_id:
100
,
name:
"Brightbox CLI"
,
path:
"brightbox-cli"
,
creator_id:
1
},
{
id:
4
,
namespace_id:
100
,
name:
"Puppet"
,
path:
"puppet"
,
creator_id:
1
},
group
=
Group
.
find_by_path
(
group_path
)
# KDE
{
id:
5
,
namespace_id:
101
,
name:
"kdebase"
,
path:
"kdebase"
,
creator_id:
1
},
{
id:
6
,
namespace_id:
101
,
name:
"kdelibs"
,
path:
"kdelibs"
,
creator_id:
1
},
{
id:
7
,
namespace_id:
101
,
name:
"amarok"
,
path:
"amarok"
,
creator_id:
1
},
unless
group
group
=
Group
.
new
(
name:
group_path
.
titleize
,
path:
group_path
)
group
.
owner
=
User
.
first
group
.
save
end
# GitLab
{
id:
8
,
namespace_id:
99
,
name:
"gitlabhq"
,
path:
"gitlabhq"
,
creator_id:
1
},
{
id:
9
,
namespace_id:
99
,
name:
"gitlab-ci"
,
path:
"gitlab-ci"
,
creator_id:
1
},
{
id:
10
,
namespace_id:
99
,
name:
"gitlab-recipes"
,
path:
"gitlab-recipes"
,
creator_id:
1
},
])
project_path
.
gsub!
(
".git"
,
""
)
params
=
{
import_url:
url
,
namespace_id:
group
.
id
,
name:
project_path
.
titleize
}
project
=
Projects
::
CreateContext
.
new
(
User
.
first
,
params
).
execute
if
project
.
valid?
print
'.'
else
puts
project
.
errors
.
full_messages
print
'F'
end
end
db/fixtures/development/05_users.rb
浏览文件 @
f47ba909
Gitlab
::
Seeder
.
quiet
do
(
2
..
30
0
).
each
do
|
i
|
(
2
..
5
0
).
each
do
|
i
|
begin
User
.
seed
(
:id
,
[{
id:
i
,
...
...
db/fixtures/development/06_teams.rb
浏览文件 @
f47ba909
ActiveRecord
::
Base
.
observers
.
disable
:all
Gitlab
::
Seeder
.
quiet
do
Project
.
all
.
each
do
|
project
|
project
.
team
<<
[
User
.
first
,
:master
]
print
'.'
Group
.
all
.
each
do
|
group
|
User
.
all
.
sample
(
4
).
each
do
|
user
|
if
group
.
add_users
([
user
.
id
],
UsersGroup
.
group_access_roles
.
values
.
sample
)
print
'.'
else
print
'F'
end
end
end
User
.
all
.
sample
(
rand
(
10
)).
each
do
|
user
|
role
=
[
:master
,
:developer
,
:reporter
].
sample
project
.
team
<<
[
user
,
role
]
print
'.'
Project
.
all
.
each
do
|
project
|
User
.
all
.
sample
(
4
).
each
do
|
user
|
if
project
.
team
<<
[
user
,
UsersProject
.
access_roles
.
values
.
sample
]
print
'.'
else
print
'F'
end
end
end
end
db/fixtures/development/09_issues.rb
浏览文件 @
f47ba909
...
...
@@ -11,7 +11,6 @@ Gitlab::Seeder.quiet do
next
unless
user
user_id
=
user
.
id
IssueObserver
.
current_user
=
user
Issue
.
seed
(
:id
,
[{
id:
i
,
...
...
db/fixtures/development/10_merge_requests.rb
浏览文件 @
f47ba909
...
...
@@ -17,7 +17,6 @@ Gitlab::Seeder.quiet do
next
if
branches
.
uniq
.
size
<
2
user_id
=
user
.
id
MergeRequestObserver
.
current_user
=
user
MergeRequest
.
seed
(
:id
,
[{
id:
i
,
source_branch:
branches
.
first
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录