Skip to content

Commit

Permalink
Fix gitolite installation path in gitlab:env:info
Browse files Browse the repository at this point in the history
(related to #2480 and #2503)

This tasks presume of a fixed path for gitolite, relative to repos_path.
info.rake uses "#{Gitlab.config.gitolite.repos_path}/../gitolite/src/VERSION"

However, you can install gitolite wherever you want.
Hence this patch, adding a new setting in gitlab.yml.
If the user doesn't add it, gitolite installation path will be the same
than before.

M config/gitlab.yml.example:
  Add 'install_path' in 'gitolite' section
M lib/tasks/gitlab/info.rake:
  Uses '"#{Gitlab.config.gitolite.install_path}'
  If undefined, defaults to '{repos_path}/../gitolite/src/', as before
  • Loading branch information
VonC committed Jan 10, 2013
1 parent 7869869 commit b40738c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/gitlab.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ backup:

## Gitolite settings
gitolite:
install_path: /home/git/gitolite/src/ # if not defined, defaults to 'repos_path/../gitolite/src/'
admin_uri: git@localhost:gitolite-admin
# repos_path must not be a symlink
repos_path: /home/git/repositories/
Expand Down
7 changes: 6 additions & 1 deletion lib/tasks/gitlab/info.rake
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,18 @@ namespace :gitlab do


# check Gitolite version
gitolite_version_file = "#{Gitlab.config.gitolite.repos_path}/../gitolite/src/VERSION"
gitolite_install_path = "#{Gitlab.config.gitolite.install_path}"
if Dir[gitolite_install_path] == []
gitolite_install_path = "#{Gitlab.config.gitolite.repos_path}/../gitolite/src/"
end
gitolite_version_file = "#{gitolite_install_path}/VERSION"
if File.exists?(gitolite_version_file) && File.readable?(gitolite_version_file)
gitolite_version = File.read(gitolite_version_file)
end

puts ""
puts "Gitolite information".yellow
puts "Installation:\t#{gitolite_install_path}"
puts "Version:\t#{gitolite_version || "unknown".red}"
puts "Admin URI:\t#{Gitlab.config.gitolite.admin_uri}"
puts "Admin Key:\t#{Gitlab.config.gitolite.admin_key}"
Expand Down

0 comments on commit b40738c

Please sign in to comment.