Commit 6f25967c476be198853940a85f2d5d410b7bd7b1
1 parent
5add5f76
Exists in
master
and in
4 other branches
Fixed issue with git commit silently failing.
Also updated status task and installation instuctions.
Showing
3 changed files
with
28 additions
and
4 deletions
Show diff stats
doc/installation.md
| ... | ... | @@ -244,6 +244,14 @@ and ensure you have followed all of the above steps carefully. |
| 244 | 244 | # or sqlite |
| 245 | 245 | sudo -u gitlab -H bundle install --without development test mysql postgres --deployment |
| 246 | 246 | |
| 247 | +#### Configure git client | |
| 248 | + | |
| 249 | +Gitlab needs to be able to commit and push changes to gitolite. | |
| 250 | +Git requires a username and email in order to be able to do that. | |
| 251 | + | |
| 252 | + sudo -u gitlab -H git config --global user.email "gitlab@localhost" | |
| 253 | + sudo -u gitlab -H git config --global user.name "Gitlab" | |
| 254 | + | |
| 247 | 255 | #### Setup database |
| 248 | 256 | |
| 249 | 257 | sudo -u gitlab bundle exec rake gitlab:app:setup RAILS_ENV=production | ... | ... |
lib/gitlab/backend/gitolite_config.rb
| ... | ... | @@ -191,8 +191,8 @@ module Gitlab |
| 191 | 191 | |
| 192 | 192 | def push tmp_dir |
| 193 | 193 | Dir.chdir(File.join(tmp_dir, "gitolite")) |
| 194 | - system('git add -A') | |
| 195 | - system('git commit -am "GitLab"') | |
| 194 | + raise "Git add failed." unless system('git add -A') | |
| 195 | + raise "Git commit failed." unless system('git commit -am "GitLab"') | |
| 196 | 196 | if system('git push') |
| 197 | 197 | Dir.chdir(Rails.root) |
| 198 | 198 | else | ... | ... |
lib/tasks/gitlab/status.rake
| ... | ... | @@ -37,9 +37,10 @@ namespace :gitlab do |
| 37 | 37 | return |
| 38 | 38 | end |
| 39 | 39 | |
| 40 | + FileUtils.rm_rf("/tmp/gitolite_gitlab_test") | |
| 40 | 41 | begin |
| 41 | - `git clone #{Gitlab.config.gitolite_admin_uri} /tmp/gitolite_gitlab_test` | |
| 42 | - FileUtils.rm_rf("/tmp/gitolite_gitlab_test") | |
| 42 | + `git clone -q #{Gitlab.config.gitolite_admin_uri} /tmp/gitolite_gitlab_test` | |
| 43 | + raise unless $?.success? | |
| 43 | 44 | print "Can clone gitolite-admin?............" |
| 44 | 45 | puts "YES".green |
| 45 | 46 | rescue |
| ... | ... | @@ -48,6 +49,21 @@ namespace :gitlab do |
| 48 | 49 | return |
| 49 | 50 | end |
| 50 | 51 | |
| 52 | + begin | |
| 53 | + Dir.chdir("/tmp/gitolite_gitlab_test") do | |
| 54 | + `touch blah && git add blah && git commit -qm blah -- blah` | |
| 55 | + raise unless $?.success? | |
| 56 | + end | |
| 57 | + print "Can git commit?............" | |
| 58 | + puts "YES".green | |
| 59 | + rescue | |
| 60 | + print "Can git commit?............" | |
| 61 | + puts "NO".red | |
| 62 | + return | |
| 63 | + ensure | |
| 64 | + FileUtils.rm_rf("/tmp/gitolite_gitlab_test") | |
| 65 | + end | |
| 66 | + | |
| 51 | 67 | print "UMASK for .gitolite.rc is 0007? ............" |
| 52 | 68 | if open("#{git_base_path}/../.gitolite.rc").grep(/UMASK([ \t]*)=([ \t>]*)0007/).any? |
| 53 | 69 | puts "YES".green | ... | ... |