diff options
author | Michael van Rooijen <meskyanichi@gmail.com> | 2012-07-27 17:30:36 +0400 |
---|---|---|
committer | Michael van Rooijen <meskyanichi@gmail.com> | 2012-07-27 17:30:36 +0400 |
commit | 19f7b038cbf3f6097b322eb3e76df3f852f0acd4 (patch) | |
tree | 9545012998170b65976299f2910391ed91001517 /lib | |
parent | 0590aa9d6073e79ba47c4fe5c34318f6889c44d8 (diff) |
Post-receive hook should be owned by gitlab user, not git.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tasks/gitlab/backup.rake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/tasks/gitlab/backup.rake b/lib/tasks/gitlab/backup.rake index 5ae51f52218..d9053c232cd 100644 --- a/lib/tasks/gitlab/backup.rake +++ b/lib/tasks/gitlab/backup.rake @@ -142,8 +142,12 @@ namespace :gitlab do print "- Restoring repository #{project.first}... " FileUtils.rm_rf(project.second) if File.dirname(project.second) # delet old stuff 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") - Kernel.system("sudo chmod -R g+rwX #{Gitlab.config.git_base_path}") - Kernel.system("sudo chown -R #{Gitlab.config.ssh_user}:#{Gitlab.config.ssh_user} #{Gitlab.config.git_base_path}") + 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" + ] + permission_commands.each { |command| Kernel.system(command) } puts "[DONE]".green else puts "[FAILED]".red |