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 = [
projects.each do |project|
project_path = File.join(root, project[:path])
next if File.exists?(project_path)
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}",
]
if File.exists?(project_path)
print '-'
next
end
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
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, [
# Global
......
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
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