Non-interactive AWS install by running a single script.
Merge branch 'master' into non-interactive-aws-install Conflicts: doc/installation.md Fix merge mess in installation.md
This commit is contained in:
parent
eae41ad1df
commit
b80dd3d242
215 changed files with 3829 additions and 3348 deletions
|
@ -144,8 +144,7 @@ namespace :gitlab do
|
|||
if Kernel.system("cd #{File.dirname(project.second)} > /dev/null 2>&1 && git clone --bare #{backup_path_repo}/#{project.first}.bundle #{project.first}.git > /dev/null 2>&1")
|
||||
permission_commands = [
|
||||
"sudo chmod -R g+rwX #{Gitlab.config.git_base_path}",
|
||||
"sudo chown -R #{Gitlab.config.ssh_user}:#{Gitlab.config.ssh_user} #{Gitlab.config.git_base_path}",
|
||||
"sudo chown gitlab:gitlab /home/git/repositories/**/hooks/post-receive"
|
||||
"sudo chown -R #{Gitlab.config.ssh_user}:#{Gitlab.config.ssh_user} #{Gitlab.config.git_base_path}"
|
||||
]
|
||||
permission_commands.each { |command| Kernel.system(command) }
|
||||
puts "[DONE]".green
|
||||
|
|
|
@ -2,9 +2,7 @@ namespace :gitlab do
|
|||
namespace :app do
|
||||
desc "GITLAB | Enable auto merge"
|
||||
task :enable_automerge => :environment do
|
||||
Gitlab::GitHost.system.new.configure do |git|
|
||||
git.admin_all_repo
|
||||
end
|
||||
Gitlab::Gitolite.new.enable_automerge
|
||||
|
||||
Project.find_each do |project|
|
||||
if project.repo_exists? && !project.satellite.exists?
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace :gitlab do
|
|||
task :update_keys => :environment do
|
||||
puts "Starting Key"
|
||||
Key.find_each(:batch_size => 100) do |key|
|
||||
key.update_repository
|
||||
Gitlab::Gitolite.new.set_key(key.identifier, key.key, key.projects)
|
||||
print '.'
|
||||
end
|
||||
puts "Done with keys"
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
namespace :gitlab do
|
||||
namespace :app do
|
||||
desc "GITLAB | Setup production application"
|
||||
task :setup => ['db:setup', 'db:seed_fu', 'gitlab:app:enable_automerge']
|
||||
task :setup => [
|
||||
'db:setup',
|
||||
'db:seed_fu',
|
||||
'gitlab:app:enable_automerge'
|
||||
]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -56,6 +56,20 @@ namespace :gitlab do
|
|||
return
|
||||
end
|
||||
|
||||
gitolite_hooks_path = File.join(Gitlab.config.git_hooks_path, "common")
|
||||
gitlab_hook_files = ['post-receive']
|
||||
gitlab_hook_files.each do |file_name|
|
||||
dest = File.join(gitolite_hooks_path, file_name)
|
||||
print "#{dest} exists? ............"
|
||||
if File.exists?(dest)
|
||||
puts "YES".green
|
||||
else
|
||||
puts "NO".red
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if Project.count > 0
|
||||
puts "Validating projects repositories:".yellow
|
||||
Project.find_each(:batch_size => 100) do |project|
|
||||
|
@ -67,13 +81,7 @@ namespace :gitlab do
|
|||
next
|
||||
end
|
||||
|
||||
|
||||
unless File.owned?(hook_file)
|
||||
puts "post-receive file is not owner by gitlab".red
|
||||
next
|
||||
end
|
||||
|
||||
puts "post-reveice file ok".green
|
||||
puts "post-receive file ok".green
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
namespace :gitlab do
|
||||
namespace :gitolite do
|
||||
desc "GITLAB | Rewrite hooks for repos"
|
||||
task :update_hooks => :environment do
|
||||
puts "Starting Projects"
|
||||
Project.find_each(:batch_size => 100) do |project|
|
||||
begin
|
||||
if project.commit
|
||||
project.write_hooks
|
||||
print ".".green
|
||||
end
|
||||
rescue Exception => e
|
||||
print e.message.red
|
||||
end
|
||||
end
|
||||
puts "\nDone with projects"
|
||||
end
|
||||
end
|
||||
end
|
23
lib/tasks/gitlab/write_hook.rake
Normal file
23
lib/tasks/gitlab/write_hook.rake
Normal file
|
@ -0,0 +1,23 @@
|
|||
namespace :gitlab do
|
||||
namespace :gitolite do
|
||||
desc "GITLAB | Write GITLAB hook for gitolite"
|
||||
task :write_hooks => :environment do
|
||||
gitolite_hooks_path = File.join(Gitlab.config.git_hooks_path, "common")
|
||||
gitlab_hooks_path = Rails.root.join("lib", "hooks")
|
||||
|
||||
gitlab_hook_files = ['post-receive']
|
||||
|
||||
gitlab_hook_files.each do |file_name|
|
||||
source = File.join(gitlab_hooks_path, file_name)
|
||||
dest = File.join(gitolite_hooks_path, file_name)
|
||||
|
||||
puts "sudo -u root cp #{source} #{dest}".yellow
|
||||
`sudo -u root cp #{source} #{dest}`
|
||||
|
||||
puts "sudo -u root chown git:git #{dest}".yellow
|
||||
`sudo -u root chown git:git #{dest}`
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue