Commit 38985390 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Refactored and fixed seeds to work with gitlab-shell

parent 152f8786
...@@ -13,19 +13,17 @@ projects = [ ...@@ -13,19 +13,17 @@ projects = [
projects.each do |project| projects.each do |project|
project_path = File.join(root, project[:path]) project_path = File.join(root, project[:path])
next if File.exists?(project_path) if File.exists?(project_path)
print '-'
cmds = [ next
"cd #{root} && sudo -u git -H git clone --bare #{project[:git]} ./#{project[:path]}", end
"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| if system("/home/git/gitlab-shell/bin/gitlab-projects import-project #{project[:path]} #{project[:git]}")
puts cmd.yellow print '.'
`#{cmd}` else
print 'F'
end end
end end
puts "OK".green puts "OK".green
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 },
])
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, [ Project.seed(:id, [
# Global # Global
......
UsersProject.skip_callback(:save, :after, :update_repository)
Gitlab::Seeder.quiet do Gitlab::Seeder.quiet do
(1..300).each do |i| (1..300).each do |i|
...@@ -21,9 +19,4 @@ Gitlab::Seeder.quiet do ...@@ -21,9 +19,4 @@ Gitlab::Seeder.quiet do
print('.') print('.')
end end
end end
UsersProject.set_callback(:save, :after, :update_repository)
puts "\nRebuild gitolite\n".yellow
Project.all.each(&:update_repository)
puts "OK".green puts "OK".green
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