mirror of
https://github.com/gitlabhq/gitlabhq.git
synced 2025-07-21 23:56:17 +00:00
Page:
From 4.2 to 5.0
Pages
Debian
Debian.stable
Dev virtualbox image
Development
Easy setup for ubuntu
Fedora
From 2.0 to 2.1
From 2.0 to 2.2
From 2.1 to 2.2
From 2.2 and higher to 2.7
From 2.2 and higher to 2.9
From 2.2 to 2.3
From 2.3 to 2.4
From 2.4 to 2.4.1
From 2.4.1 to 2.5.0
From 2.5.0 to 2.6.0
From 2.6 to 3.0
From 2.6.x to 2.7.0
From 2.6.x to 2.9.0
From 2.7 to 2.8
From 2.7 to 2.9
From 2.8 to 2.9
From 2.9 to 3.0
From 3.0 to 3.1
From 3.0 to 4.0
From 3.1 to 4.0
From 4.0 to 4.1
From 4.1 to 4.2
From 4.2 to 5.0
From 5.0 to 5.1
From pratica to pronto
From pronto to moderno
Gitolite
Home
Import existing repositories into GitLab
Install (RedHat CentOS Fedora)
Install
Issue submission guide
Linux
Linux.stable
Migrate from SQLite to MySQL
Module Proposals and Requirements
Old Update Guides
Protect info resque
Reinstall gitolite
Ruby
Ubuntu
Ubuntu.stable
Update Gitolite
Update To Gitolite
V1.2 easy setup for ubuntu
V1.2 links
V1.2
V2.0 easy setup for ubuntu
V2.0 install
V2.0
VirtualBox Image
Vmware image
Clone
26
From 4.2 to 5.0
Ben Bodenmiller edited this page 2014-01-02 05:04:46 -08:00
Table of Contents
Important changes
- We don't use
gitlab
user any more. Everything will be moved togit
user - requires ruby1.9.3
0. Stop gitlab
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
# backup current config
sudo -u git -H cp config/gitlab.yml config/gitlab.yml.old
sudo -u git -H git fetch
sudo -u git -H git checkout 5-0-stable
# replace config with recent one
sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml
# edit it
sudo -u git -H vim config/gitlab.yml
sudo -u git -H bundle install --without development test postgres --deployment
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 mkdir /home/git/gitlab-satellites
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
# check permissions for /home/git/gitlab/
sudo chown -R git /home/git/gitlab/log/
sudo chown -R git /home/git/gitlab/tmp/
sudo chmod -R u+rwX /home/git/gitlab/log/
sudo chmod -R u+rwX /home/git/gitlab/tmp/
sudo -u git -H mkdir /home/git/gitlab/tmp/pids/
sudo chmod -R u+rwX /home/git/gitlab/tmp/pids
6. Update init.d script and nginx config
# init.d
sudo rm /etc/init.d/gitlab
sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/5-0-stable/init.d/gitlab
sudo chmod +x /etc/init.d/gitlab
# unicorn
sudo -u git -H cp /home/git/gitlab/config/unicorn.rb /home/git/gitlab/config/unicorn.rb.old
sudo -u git -H cp /home/git/gitlab/config/unicorn.rb.example /home/git/gitlab/config/unicorn.rb
#nginx
# Replace path from '/home/gitlab/' to '/home/git/'
sudo vim /etc/nginx/sites-enabled/gitlab
sudo service nginx restart
7. Start gitlab instace
sudo service gitlab start
# check if unicorn and sidekiq started
# If not try to logout, also check replaced path from '/home/gitlab/' to '/home/git/'
# in nginx, unicorn, init.d etc
ps aux | grep unicorn
ps aux | grep sidekiq
8. Check installation
# In 5-10 seconds lets check gitlab-shell
sudo -u git -H /home/git/gitlab-shell/bin/check
# Example of success output
# Check GitLab API access: OK
# Check directories and files:
# /home/git/repositories: OK
# /home/git/.ssh/authorized_keys: OK
# Now check gitlab instance
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
P.S. If everything works as expected you can remove gitlab user from system