Refactored and fixed seeds to work with gitlab-shell
This commit is contained in:
parent
152f87864c
commit
38985390b0
11 changed files with 14 additions and 24 deletions
|
@ -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 '-'
|
||||||
|
next
|
||||||
|
end
|
||||||
|
|
||||||
cmds = [
|
if system("/home/git/gitlab-shell/bin/gitlab-projects import-project #{project[:path]} #{project[:git]}")
|
||||||
"cd #{root} && sudo -u git -H git clone --bare #{project[:git]} ./#{project[:path]}",
|
print '.'
|
||||||
"sudo ln -s ./lib/hooks/post-receive #{project_path}/hooks/post-receive",
|
else
|
||||||
"sudo chown git:git -R #{project_path}",
|
print 'F'
|
||||||
"sudo chmod 770 -R #{project_path}",
|
|
||||||
]
|
|
||||||
|
|
||||||
cmds.each do |cmd|
|
|
||||||
puts cmd.yellow
|
|
||||||
`#{cmd}`
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
puts "OK".green
|
puts "OK".green
|
||||||
|
|
5
db/fixtures/development/03_group.rb
Normal file
5
db/fixtures/development/03_group.rb
Normal file
|
@ -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 },
|
||||||
|
])
|
|
@ -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, [
|
Project.seed(:id, [
|
||||||
|
|
||||||
# Global
|
# Global
|
|
@ -1,5 +1,3 @@
|
||||||
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
|
||||||
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
|
Loading…
Add table
Reference in a new issue