Commit 19f7b038cbf3f6097b322eb3e76df3f852f0acd4
1 parent
0590aa9d
Exists in
master
and in
4 other branches
Post-receive hook should be owned by gitlab user, not git.
Showing
1 changed file
with
6 additions
and
2 deletions
Show diff stats
lib/tasks/gitlab/backup.rake
... | ... | @@ -142,8 +142,12 @@ namespace :gitlab do |
142 | 142 | print "- Restoring repository #{project.first}... " |
143 | 143 | FileUtils.rm_rf(project.second) if File.dirname(project.second) # delet old stuff |
144 | 144 | 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") |
145 | - Kernel.system("sudo chmod -R g+rwX #{Gitlab.config.git_base_path}") | |
146 | - Kernel.system("sudo chown -R #{Gitlab.config.ssh_user}:#{Gitlab.config.ssh_user} #{Gitlab.config.git_base_path}") | |
145 | + permission_commands = [ | |
146 | + "sudo chmod -R g+rwX #{Gitlab.config.git_base_path}", | |
147 | + "sudo chown -R #{Gitlab.config.ssh_user}:#{Gitlab.config.ssh_user} #{Gitlab.config.git_base_path}", | |
148 | + "sudo chown gitlab:gitlab /home/git/repositories/**/hooks/post-receive" | |
149 | + ] | |
150 | + permission_commands.each { |command| Kernel.system(command) } | |
147 | 151 | puts "[DONE]".green |
148 | 152 | else |
149 | 153 | puts "[FAILED]".red | ... | ... |