2012-11-13 21:11:56 +01:00
|
|
|
root = Gitlab.config.git_base_path
|
|
|
|
|
|
|
|
projects = [
|
2012-11-21 06:54:05 +01:00
|
|
|
{ path: 'root/underscore.git', git: 'https://github.com/documentcloud/underscore.git' },
|
2012-11-13 21:11:56 +01:00
|
|
|
{ path: 'diaspora.git', git: 'https://github.com/diaspora/diaspora.git' },
|
|
|
|
{ path: 'rails.git', git: 'https://github.com/rails/rails.git' },
|
|
|
|
]
|
|
|
|
|
|
|
|
projects.each do |project|
|
|
|
|
project_path = File.join(root, project[:path])
|
|
|
|
|
|
|
|
|
|
|
|
next if File.exists?(project_path)
|
|
|
|
|
|
|
|
cmds = [
|
2012-11-21 06:54:05 +01:00
|
|
|
"cd #{root} && sudo -u git -H git clone --bare #{project[:git]} ./#{project[:path]}",
|
2012-11-13 21:11:56 +01:00
|
|
|
"sudo cp ./lib/hooks/post-receive #{project_path}/hooks/post-receive",
|
2012-11-21 06:54:05 +01:00
|
|
|
"sudo chown git:git -R #{project_path}",
|
|
|
|
"sudo chmod 770 -R #{project_path}",
|
2012-11-13 21:11:56 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
cmds.each do |cmd|
|
|
|
|
puts cmd.yellow
|
|
|
|
`#{cmd}`
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
puts "OK".green
|