-
Notifications
You must be signed in to change notification settings - Fork 2
From 4.2 to 5.0
randx edited this page Mar 20, 2013
·
26 revisions
Before: sudo service gitlab stop
1. add bash to git user
sudo chsh -s /bin/bash git
2. git clone gitlab-shell
sudo -u git -H git clone https://github.com/gitlabhq/gitlab-shell.git /home/git/gitlab-shell
3. setup gitlab-shell
# chmod all repos and files under git
sudo chown git:git -R /home/git/repositories/
# login as git
sudo su git
cd /home/git/gitlab-shell
# copy config
cp config.yml.example config.yml
# change url to gitlab instance
# ! make sure url end with '/' like 'https://gitlab.example/'
vim config.yml
# rewrite hooks
./support/rewrite-hooks.sh
# check ruby version for git user ( 1.9 required!! )
# gitlab shell requires system ruby 1.9
ruby -v
# exit from git user
exit
4. Copy gitlab instance to git user
sudo cp -R /home/gitlab/gitlab /home/git/gitlab
sudo chown git:git -R /home/git/gitlab
sudo rm -rf /home/gitlab/gitlab-satellites
# if exists
sudo rm /tmp/gitlab.socket
5. Update gitlab to recent version
cd /home/git/gitlab
# change satellites path, repos_path etc...
vim config/gitlab.yml
sudo -u git -H git fetch
sudo -u git -H git checkout 5-0-stable
sudo -u git -H bundle
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
sudo -u git -H bundle exec rake gitlab:shell:setup RAILS_ENV=production
sudo -u git -H bundle exec rake gitlab:shell:build_missing_projects RAILS_ENV=production
sudo -u git -H bundle exec rake gitlab:satellites:create RAILS_ENV=production
# migrate wiki to git
sudo -u git -H bundle exec rake gitlab:wiki:migrate RAILS_ENV=production
# check permissions for /home/git/.ssh/
sudo -u git -H chmod 700 /home/git/.ssh
sudo -u git -H chmod 600 /home/git/.ssh/authorized_keys
6. Update init.d script and nginx config
7. Start gitlab instace
sudo service gitlab start
# In 5-10 seconds lets check gitlab-shell
sudo -u git -H /home/git/gitlab-shell/bin/check