Commit aded7056fd3a9830215f41233ef609c0f9a3b862
Exists in
master
and in
4 other branches
Merge pull request #1313 from LeonB/master
Fixed some hardcoded paths based on issue #1272
Showing
5 changed files
with
8 additions
and
3 deletions
Show diff stats
config/gitlab.yml.example
| ... | ... | @@ -33,6 +33,7 @@ app: |
| 33 | 33 | git_host: |
| 34 | 34 | admin_uri: git@localhost:gitolite-admin |
| 35 | 35 | base_path: /home/git/repositories/ |
| 36 | + # hooks_path: /var/lib/gitolite/.gitolite/hooks/ # only needed when gitolite is not installed according the manual | |
| 36 | 37 | # host: localhost |
| 37 | 38 | git_user: git |
| 38 | 39 | upload_pack: true | ... | ... |
config/initializers/1_settings.rb
| ... | ... | @@ -66,6 +66,10 @@ class Settings < Settingslogic |
| 66 | 66 | git_host['base_path'] || '/home/git/repositories/' |
| 67 | 67 | end |
| 68 | 68 | |
| 69 | + def git_hooks_path | |
| 70 | + git_host['hooks_path'] || '/home/git/share/gitolite/hooks/' | |
| 71 | + end | |
| 72 | + | |
| 69 | 73 | def git_upload_pack |
| 70 | 74 | if git_host['upload_pack'] != false |
| 71 | 75 | true | ... | ... |
lib/tasks/gitlab/backup.rake
| ... | ... | @@ -144,7 +144,7 @@ namespace :gitlab do |
| 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 | 145 | permission_commands = [ |
| 146 | 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}", | |
| 147 | + "sudo chown -R #{Gitlab.config.ssh_user}:#{Gitlab.config.ssh_user} #{Gitlab.config.git_base_path}" | |
| 148 | 148 | ] |
| 149 | 149 | permission_commands.each { |command| Kernel.system(command) } |
| 150 | 150 | puts "[DONE]".green | ... | ... |
lib/tasks/gitlab/status.rake
| ... | ... | @@ -56,7 +56,7 @@ namespace :gitlab do |
| 56 | 56 | return |
| 57 | 57 | end |
| 58 | 58 | |
| 59 | - gitolite_hooks_path = File.join("/home", Gitlab.config.ssh_user, "share", "gitolite", "hooks", "common") | |
| 59 | + gitolite_hooks_path = File.join(Gitlab.config.git_hooks_path, "common") | |
| 60 | 60 | gitlab_hook_files = ['post-receive'] |
| 61 | 61 | gitlab_hook_files.each do |file_name| |
| 62 | 62 | dest = File.join(gitolite_hooks_path, file_name) | ... | ... |
lib/tasks/gitlab/write_hook.rake
| ... | ... | @@ -2,7 +2,7 @@ namespace :gitlab do |
| 2 | 2 | namespace :gitolite do |
| 3 | 3 | desc "GITLAB | Write GITLAB hook for gitolite" |
| 4 | 4 | task :write_hooks => :environment do |
| 5 | - gitolite_hooks_path = File.join("/home", Gitlab.config.ssh_user, "share", "gitolite", "hooks", "common") | |
| 5 | + gitolite_hooks_path = File.join(Gitlab.config.git_hooks_path, "common") | |
| 6 | 6 | gitlab_hooks_path = Rails.root.join("lib", "hooks") |
| 7 | 7 | |
| 8 | 8 | gitlab_hook_files = ['post-receive'] | ... | ... |