Commit c92726e6c8a995e1555c31411977d6bcce25c1e3

Authored by Dmitriy Zaporozhets
1 parent 5d219bd5

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

db/fixtures/development/002_project.rb
  1 +Group.seed(:id, [
  2 + { id: 100, name: "Brightbox", path: 'brightbox', owner_id: 1 },
  3 + { id: 101, name: "KDE", path: 'kde', owner_id: 1 },
  4 +])
  5 +
1 6 Project.seed(:id, [
2   - { id: 1, name: "Underscore.js", path: "underscore", owner_id: 1, namespace_id: 1 },
  7 + { id: 1, name: "Underscore.js", path: "underscore", owner_id: 1 },
3 8 { id: 2, name: "Diaspora", path: "diaspora", owner_id: 1 },
4   - { id: 3, name: "Ruby on Rails", path: "rails", owner_id: 1 }
  9 + { id: 3, namespace_id: 100, name: "Brightbox CLI", path: "brightbox-cli", owner_id: 1 },
  10 + { id: 4, namespace_id: 100, name: "Puppet", path: "puppet", owner_id: 1 },
  11 + { id: 5, namespace_id: 101, name: "kdebase", path: "kdebase", owner_id: 1},
  12 + { id: 6, namespace_id: 101, name: "kdelibs", path: "kdelibs", owner_id: 1},
  13 + { id: 7, namespace_id: 101, name: "amarok", path: "amarok", owner_id: 1},
5 14 ])
... ...
db/fixtures/development/009_source_code.rb
1 1 root = Gitlab.config.git_base_path
2 2  
3 3 projects = [
4   - { path: 'root/underscore.git', git: 'https://github.com/documentcloud/underscore.git' },
  4 + { path: 'underscore.git', git: 'https://github.com/documentcloud/underscore.git' },
5 5 { path: 'diaspora.git', git: 'https://github.com/diaspora/diaspora.git' },
6   - { path: 'rails.git', git: 'https://github.com/rails/rails.git' },
  6 + { path: 'brightbox/brightbox-cli.git', git: 'https://github.com/brightbox/brightbox-cli.git' },
  7 + { path: 'brightbox/puppet.git', git: 'https://github.com/brightbox/puppet.git' },
7 8 ]
8 9  
9 10 projects.each do |project|
... ... @@ -14,7 +15,7 @@ projects.each do |project|
14 15  
15 16 cmds = [
16 17 "cd #{root} && sudo -u git -H git clone --bare #{project[:git]} ./#{project[:path]}",
17   - "sudo cp ./lib/hooks/post-receive #{project_path}/hooks/post-receive",
  18 + "sudo ln -s ./lib/hooks/post-receive #{project_path}/hooks/post-receive",
18 19 "sudo chown git:git -R #{project_path}",
19 20 "sudo chmod 770 -R #{project_path}",
20 21 ]
... ...
db/fixtures/development/010_groups.rb
... ... @@ -1,11 +0,0 @@
1   -Group.seed(:id, [
2   - { id: 100, name: "Gitlab", path: 'gitlab', owner_id: 1},
3   - { id: 101, name: "Rails", path: 'rails', owner_id: 1 },
4   - { id: 102, name: "KDE", path: 'kde', owner_id: 1 }
5   -])
6   -
7   -Project.seed(:id, [
8   - { id: 10, name: "kdebase", path: "kdebase", owner_id: 1, namespace_id: 102 },
9   - { id: 11, name: "kdelibs", path: "kdelibs", owner_id: 1, namespace_id: 102 },
10   - { id: 12, name: "amarok", path: "amarok", owner_id: 1, namespace_id: 102 }
11   -])