Commit c92726e6 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Reordered developers seeds a bit. Now seeds faster and has valid post-receive files

parent 5d219bd5
Group.seed(:id, [
{ id: 100, name: "Brightbox", path: 'brightbox', owner_id: 1 },
{ id: 101, name: "KDE", path: 'kde', owner_id: 1 },
])
Project.seed(:id, [ Project.seed(:id, [
{ id: 1, name: "Underscore.js", path: "underscore", owner_id: 1, namespace_id: 1 }, { id: 1, name: "Underscore.js", path: "underscore", owner_id: 1 },
{ id: 2, name: "Diaspora", path: "diaspora", owner_id: 1 }, { id: 2, name: "Diaspora", path: "diaspora", owner_id: 1 },
{ id: 3, name: "Ruby on Rails", path: "rails", owner_id: 1 } { id: 3, namespace_id: 100, name: "Brightbox CLI", path: "brightbox-cli", owner_id: 1 },
{ id: 4, namespace_id: 100, name: "Puppet", path: "puppet", owner_id: 1 },
{ id: 5, namespace_id: 101, name: "kdebase", path: "kdebase", owner_id: 1},
{ id: 6, namespace_id: 101, name: "kdelibs", path: "kdelibs", owner_id: 1},
{ id: 7, namespace_id: 101, name: "amarok", path: "amarok", owner_id: 1},
]) ])
root = Gitlab.config.git_base_path root = Gitlab.config.git_base_path
projects = [ projects = [
{ path: 'root/underscore.git', git: 'https://github.com/documentcloud/underscore.git' }, { path: 'underscore.git', git: 'https://github.com/documentcloud/underscore.git' },
{ path: 'diaspora.git', git: 'https://github.com/diaspora/diaspora.git' }, { path: 'diaspora.git', git: 'https://github.com/diaspora/diaspora.git' },
{ path: 'rails.git', git: 'https://github.com/rails/rails.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' },
] ]
projects.each do |project| projects.each do |project|
...@@ -14,7 +15,7 @@ projects.each do |project| ...@@ -14,7 +15,7 @@ projects.each do |project|
cmds = [ cmds = [
"cd #{root} && sudo -u git -H git clone --bare #{project[:git]} ./#{project[:path]}", "cd #{root} && sudo -u git -H git clone --bare #{project[:git]} ./#{project[:path]}",
"sudo cp ./lib/hooks/post-receive #{project_path}/hooks/post-receive", "sudo ln -s ./lib/hooks/post-receive #{project_path}/hooks/post-receive",
"sudo chown git:git -R #{project_path}", "sudo chown git:git -R #{project_path}",
"sudo chmod 770 -R #{project_path}", "sudo chmod 770 -R #{project_path}",
] ]
......
Group.seed(:id, [
{ id: 100, name: "Gitlab", path: 'gitlab', owner_id: 1},
{ id: 101, name: "Rails", path: 'rails', owner_id: 1 },
{ id: 102, name: "KDE", path: 'kde', owner_id: 1 }
])
Project.seed(:id, [
{ id: 10, name: "kdebase", path: "kdebase", owner_id: 1, namespace_id: 102 },
{ id: 11, name: "kdelibs", path: "kdelibs", owner_id: 1, namespace_id: 102 },
{ id: 12, name: "amarok", path: "amarok", owner_id: 1, namespace_id: 102 }
])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment