Project -> update repo only on create and destroy. Fixtures Updated with namespaces. Fixed moving repo

This commit is contained in:
Dmitriy Zaporozhets 2012-11-21 08:54:05 +03:00
parent cc52eed981
commit 70bf7f6e19
11 changed files with 45 additions and 31 deletions

View file

@ -1,22 +1,11 @@
unless User.count > 0
admin = User.create(
email: "admin@local.host",
User.seed(:id, [
{
id: 1,
name: "Administrator",
email: "admin@local.host",
username: 'root',
password: "5iveL!fe",
password_confirmation: "5iveL!fe"
)
admin.projects_limit = 10000
admin.admin = true
admin.save!
if admin.valid?
puts %q[
Administrator account created:
login.........admin@local.host
password......5iveL!fe
]
end
end
password_confirmation: "5iveL!fe",
admin: true,
}
])

View file

@ -1,5 +1,5 @@
Project.seed(:id, [
{ id: 1, name: "Underscore.js", path: "underscore", owner_id: 1 },
{ id: 1, name: "Underscore.js", path: "underscore", owner_id: 1, namespace_id: 1 },
{ id: 2, name: "Diaspora", path: "diaspora", owner_id: 1 },
{ id: 3, name: "Ruby on Rails", path: "rails", owner_id: 1 }
])

View file

@ -1,7 +1,7 @@
root = Gitlab.config.git_base_path
projects = [
{ path: 'underscore.git', git: 'https://github.com/documentcloud/underscore.git' },
{ path: 'root/underscore.git', git: 'https://github.com/documentcloud/underscore.git' },
{ path: 'diaspora.git', git: 'https://github.com/diaspora/diaspora.git' },
{ path: 'rails.git', git: 'https://github.com/rails/rails.git' },
]
@ -13,9 +13,10 @@ projects.each do |project|
next if File.exists?(project_path)
cmds = [
"cd #{root} && sudo -u git -H git clone --bare #{project[:git]}",
"cd #{root} && sudo -u git -H git clone --bare #{project[:git]} ./#{project[:path]}",
"sudo cp ./lib/hooks/post-receive #{project_path}/hooks/post-receive",
"sudo chown git:git #{project_path}/hooks/post-receive"
"sudo chown git:git -R #{project_path}",
"sudo chmod 770 -R #{project_path}",
]
cmds.each do |cmd|