diff --git a/db/fixtures/development/001_admin.rb b/db/fixtures/development/01_admin.rb similarity index 100% rename from db/fixtures/development/001_admin.rb rename to db/fixtures/development/01_admin.rb diff --git a/db/fixtures/development/009_source_code.rb b/db/fixtures/development/02_source_code.rb similarity index 69% rename from db/fixtures/development/009_source_code.rb rename to db/fixtures/development/02_source_code.rb index a64b905e..4a9e5d0c 100644 --- a/db/fixtures/development/009_source_code.rb +++ b/db/fixtures/development/02_source_code.rb @@ -13,19 +13,17 @@ projects = [ projects.each do |project| project_path = File.join(root, project[:path]) - next if File.exists?(project_path) + if File.exists?(project_path) + print '-' + next + end - cmds = [ - "cd #{root} && sudo -u git -H git clone --bare #{project[:git]} ./#{project[:path]}", - "sudo ln -s ./lib/hooks/post-receive #{project_path}/hooks/post-receive", - "sudo chown git:git -R #{project_path}", - "sudo chmod 770 -R #{project_path}", - ] - - cmds.each do |cmd| - puts cmd.yellow - `#{cmd}` + if system("/home/git/gitlab-shell/bin/gitlab-projects import-project #{project[:path]} #{project[:git]}") + print '.' + else + print 'F' end end puts "OK".green + diff --git a/db/fixtures/development/03_group.rb b/db/fixtures/development/03_group.rb new file mode 100644 index 00000000..01174a4b --- /dev/null +++ b/db/fixtures/development/03_group.rb @@ -0,0 +1,5 @@ +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 }, +]) diff --git a/db/fixtures/development/002_project.rb b/db/fixtures/development/04_project.rb similarity index 81% rename from db/fixtures/development/002_project.rb rename to db/fixtures/development/04_project.rb index e50ab5d9..9904c48e 100644 --- a/db/fixtures/development/002_project.rb +++ b/db/fixtures/development/04_project.rb @@ -1,9 +1,3 @@ -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 }, -]) - Project.seed(:id, [ # Global diff --git a/db/fixtures/development/003_users.rb b/db/fixtures/development/05_users.rb similarity index 100% rename from db/fixtures/development/003_users.rb rename to db/fixtures/development/05_users.rb diff --git a/db/fixtures/development/004_teams.rb b/db/fixtures/development/06_teams.rb similarity index 66% rename from db/fixtures/development/004_teams.rb rename to db/fixtures/development/06_teams.rb index 7a8f9139..9fbf21a0 100644 --- a/db/fixtures/development/004_teams.rb +++ b/db/fixtures/development/06_teams.rb @@ -1,5 +1,3 @@ -UsersProject.skip_callback(:save, :after, :update_repository) - Gitlab::Seeder.quiet do (1..300).each do |i| @@ -21,9 +19,4 @@ Gitlab::Seeder.quiet do print('.') end end - -UsersProject.set_callback(:save, :after, :update_repository) - -puts "\nRebuild gitolite\n".yellow -Project.all.each(&:update_repository) puts "OK".green diff --git a/db/fixtures/development/005_milestones.rb b/db/fixtures/development/07_milestones.rb similarity index 100% rename from db/fixtures/development/005_milestones.rb rename to db/fixtures/development/07_milestones.rb diff --git a/db/fixtures/development/006_wall.rb b/db/fixtures/development/08_wall.rb similarity index 100% rename from db/fixtures/development/006_wall.rb rename to db/fixtures/development/08_wall.rb diff --git a/db/fixtures/development/007_issues.rb b/db/fixtures/development/09_issues.rb similarity index 100% rename from db/fixtures/development/007_issues.rb rename to db/fixtures/development/09_issues.rb diff --git a/db/fixtures/development/008_merge_requests.rb b/db/fixtures/development/10_merge_requests.rb similarity index 100% rename from db/fixtures/development/008_merge_requests.rb rename to db/fixtures/development/10_merge_requests.rb diff --git a/db/fixtures/development/010_keys.rb b/db/fixtures/development/11_keys.rb similarity index 100% rename from db/fixtures/development/010_keys.rb rename to db/fixtures/development/11_keys.rb