Das Update auf Gitlab 4.1 von Gitlab 4.0 habe ich heute - also recht spät - gemacht, da in dem Blogeintrag zum Update über einige Probleme berichtet wurde. Da wollte ich erst einmal die ersten Bugfixes abwarten wollte.
Beim Update habe ich mich an einen Mix aus dem offziellen Update Guide und meiner Update-Anleitung für 4.0 gehalten.
Als root:
/etc/init.d/httpd stop cd /home/gitlab/gitlab/ chown -R gitlab:gitlab /home/gitlab/gitlab chmod -R ug+rwXs /home/git/repositories/ chown -R git:git /home/git/repositories/
Als gitlab:
cd gitlab/ git fetch git stash git checkout 4-1-stable bundle install --without development test postgres bundle exec rake db:migrate RAILS_ENV=production bundle exec rake gitlab:check RAILS_ENV=production
Beim Check ergaben sich u.a. folgende Fehler:
Checking Environment ... Checking Gitolite ... Using recommended version ... no post-receive hook up-to-date? ... no Try fixing it: sudo -u git cp /home/gitlab/gitlab/lib/hooks/post-receive /home/git/.gitolite/hooks/common/post-receive
Gitolite und der Post-Receive-Hook waren nicht mehr aktuell. Deshalb musste zunächst Gitolite aktualisiert werden. Dafür sollte/muss zunächst ein Backup von /home/git/gitolite und /home/git/repositories gemacht werden.
Als git (geht vermutlich auch als root):
git clone -b gl-v320 https github.com/gitlabhq/gitolite.git /home/git/gitolite
Als root:
sudo -u git -H sh -c 'printf "%b\n%b\n" "PATH=\$PATH:/home/git/bin" "export PATH" >> /home/git/.profile' sudo -u git -H sh -c 'gitolite/install -ln /home/git/bin' sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub sudo chmod 0444 /home/git/gitlab.pub sudo -u git -H sh -c "PATH=/home/git/bin:$PATH; gitolite setup -pk /home/git/gitlab.pub" sudo chmod 750 /home/git/.gitolite/ sudo chown -R git:git /home/git/.gitolite/ sudo chmod -R ug+rwXs,o-rwx /home/git/repositories/ sudo chown -R git:git /home/git/repositories/ sudo -u gitlab -H git config --global user.name "GitLab" sudo -u gitlab -H git config --global user.email "gitlab@localhost" sudo -u gitlab -H git clone git@localhost:gitolite-admin.git /tmp/gitolite-admin sudo rm -rf /tmp/gitolite-admin
Wie es in der offiziellen Installationsanleitung heißt: Nicht weitermachen, wenn clonen von gitolite-admin nicht funktioniert.
Als gitlab:
bundle exec rake gitlab:gitolite:update_keys RAILS_ENV=production bundle exec rake gitlab:gitolite:update_repos RAILS_ENV=production
Als root:
cp /home/gitlab/gitlab/lib/hooks/post-receive /home/git/.gitolite/hooks/common/
Als gitlab:
bundle exec rake gitlab:check RAILS_ENV=production Checking Sidekiq ... Running? ... no Try fixing it: sudo -u gitlab -H bundle exec rake sidekiq:start
Jetzt musste nur noch Sidekiq und der Apache gestartet werden und schon lief Gitlab wieder:
bundle exec rake sidekiq:start RAILS_ENV=production bundle exec rake gitlab:check RAILS_ENV=production /etc/init.d/httpd start