Commit 6f25967c476be198853940a85f2d5d410b7bd7b1

Authored by David Barri
1 parent 5add5f76

Fixed issue with git commit silently failing.

Also updated status task and installation instuctions.
doc/installation.md
@@ -244,6 +244,14 @@ and ensure you have followed all of the above steps carefully. @@ -244,6 +244,14 @@ and ensure you have followed all of the above steps carefully.
244 # or sqlite 244 # or sqlite
245 sudo -u gitlab -H bundle install --without development test mysql postgres --deployment 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 #### Setup database 255 #### Setup database
248 256
249 sudo -u gitlab bundle exec rake gitlab:app:setup RAILS_ENV=production 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,8 +191,8 @@ module Gitlab
191 191
192 def push tmp_dir 192 def push tmp_dir
193 Dir.chdir(File.join(tmp_dir, "gitolite")) 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 if system('git push') 196 if system('git push')
197 Dir.chdir(Rails.root) 197 Dir.chdir(Rails.root)
198 else 198 else
lib/tasks/gitlab/status.rake
@@ -37,9 +37,10 @@ namespace :gitlab do @@ -37,9 +37,10 @@ namespace :gitlab do
37 return 37 return
38 end 38 end
39 39
  40 + FileUtils.rm_rf("/tmp/gitolite_gitlab_test")
40 begin 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 print "Can clone gitolite-admin?............" 44 print "Can clone gitolite-admin?............"
44 puts "YES".green 45 puts "YES".green
45 rescue 46 rescue
@@ -48,6 +49,21 @@ namespace :gitlab do @@ -48,6 +49,21 @@ namespace :gitlab do
48 return 49 return
49 end 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 print "UMASK for .gitolite.rc is 0007? ............" 67 print "UMASK for .gitolite.rc is 0007? ............"
52 if open("#{git_base_path}/../.gitolite.rc").grep(/UMASK([ \t]*)=([ \t>]*)0007/).any? 68 if open("#{git_base_path}/../.gitolite.rc").grep(/UMASK([ \t]*)=([ \t>]*)0007/).any?
53 puts "YES".green 69 puts "YES".green