Commit 0b55ec11d50e75a145d5b7efbcb5d25e0a4a210e

Authored by Dmitriy Zaporozhets
2 parents e7adcaa5 a7ad0954

Merge pull request #3783 from senny/move_update_instructions_to_repo

move the update guides from the wiki into the repo
doc/update/2.6-to-3.0.md 0 → 100644
... ... @@ -0,0 +1,63 @@
  1 +# From 2.6 to 3.0
  2 +
  3 +### 1. Stop server & resque
  4 +
  5 + sudo service gitlab stop
  6 +
  7 +### 2. Update code & db
  8 +
  9 +
  10 +```bash
  11 +# Get latest code
  12 +git fetch origin
  13 +git checkout v3.0.3
  14 +
  15 +
  16 +# Install libs
  17 +sudo -u gitlab bundle install --without development test postgres
  18 +
  19 +# update db
  20 +sudo -u gitlab bundle exec rake db:migrate RAILS_ENV=production
  21 +
  22 +# !!! Config should be replaced with a new one. Check it after replace
  23 +cp config/gitlab.yml.example config/gitlab.yml
  24 +
  25 +# update gitolite hooks
  26 +
  27 +# GITOLITE v2:
  28 +sudo cp ./lib/hooks/post-receive /home/git/share/gitolite/hooks/common/post-receive
  29 +sudo chown git:git /home/git/share/gitolite/hooks/common/post-receive
  30 +
  31 +# GITOLITE v3:
  32 +sudo cp ./lib/hooks/post-receive /home/git/.gitolite/hooks/common/post-receive
  33 +sudo chown git:git /home/git/.gitolite/hooks/common/post-receive
  34 +
  35 +# set valid path to hooks in gitlab.yml in git_host section
  36 +# like this
  37 +git_host:
  38 + # gitolite 2
  39 + hooks_path: /home/git/share/gitolite/hooks
  40 + # gitolite 3
  41 + hooks_path: /home/git/.gitolite/hooks/
  42 +
  43 +
  44 +# Make some changes to gitolite config
  45 +# For more information visit https://github.com/gitlabhq/gitlabhq/pull/1719
  46 +
  47 +# gitolite v2
  48 +sudo -u git -H sed -i 's/\(GL_GITCONFIG_KEYS\s*=>*\s*\).\{2\}/\\1"\.\*"/g' /home/git/.gitolite.rc
  49 +
  50 +# gitlite v3
  51 +sudo -u git -H sed -i "s/\(GIT_CONFIG_KEYS\s*=>*\s*\).\{2\}/\\1'\.\*'/g" /home/git/.gitolite.rc
  52 +
  53 +
  54 +# Check app status
  55 +sudo -u gitlab bundle exec rake gitlab:app:status RAILS_ENV=production
  56 +
  57 +
  58 +```
  59 +
  60 +
  61 +### 3. Start all
  62 +
  63 + sudo service gitlab start
... ...
doc/update/2.9-to-3.0.md 0 → 100644
... ... @@ -0,0 +1,37 @@
  1 +# From 2.9 to 3.0
  2 +
  3 +### 1. Stop server & resque
  4 +
  5 + sudo service gitlab stop
  6 +
  7 +### 2. Follow instructions
  8 +
  9 +```bash
  10 +
  11 +# Get latest code
  12 +sudo -u gitlab -H git fetch origin
  13 +sudo -u gitlab -H git checkout v3.0.3
  14 +
  15 +# Install gems
  16 +sudo -u gitlab -H bundle install --without development test postgres
  17 +
  18 +# Migrate db
  19 +sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production
  20 +
  21 +# Make some changes to gitolite v3 config
  22 +# For more information visit https://github.com/gitlabhq/gitlabhq/pull/1719
  23 +
  24 +# Gitolite version 3
  25 +sudo -u git -H sed -i "s/\(GIT_CONFIG_KEYS\s*=>*\s*\).\{2\}/\\1'\.\*'/g" /home/git/.gitolite.rc
  26 +
  27 +# If you still use gitolite v2
  28 +sudo -u git -H sed -i 's/\(GL_GITCONFIG_KEYS\s*=>*\s*\).\{2\}/\\1"\.\*"/g' /home/git/.gitolite.rc
  29 +
  30 +# Check APP Status
  31 +sudo -u gitlab -H bundle exec rake gitlab:app:status RAILS_ENV=production
  32 +```
  33 +
  34 +
  35 +### 3. Start all
  36 +
  37 + sudo service gitlab start
... ...
doc/update/3.0-to-3.1.md 0 → 100644
... ... @@ -0,0 +1,108 @@
  1 +# From 3.0 to 3.1
  2 +
  3 +__IMPORTANT!__
  4 +
  5 +In this release __we moved Resque jobs under own gitlab namespace__.
  6 +
  7 +Despite a lot of advantages it requires from our users to __replace gitolite post-receive hook with new one__.
  8 +
  9 +Most of projects has post-receive file as symlink to gitolite `/home/git/.gitolite/hooks/post-receive`.
  10 +But some of them may have a real file. In this case you should rewrite it with symlink to gitolite hook.
  11 +
  12 +I wrote a bash script which will do it automatically for you. Just make sure all path inside is valid for you
  13 +
  14 +- - -
  15 +
  16 +### 1. Stop server & resque
  17 +
  18 + sudo service gitlab stop
  19 +
  20 +### 2. Update GitLab
  21 +
  22 +```bash
  23 +
  24 +# Get latest code
  25 +sudo -u gitlab -H git fetch
  26 +sudo -u gitlab -H git checkout v3.1.0
  27 +
  28 +# Install new charlock_holmes
  29 +sudo gem install charlock_holmes --version '0.6.9'
  30 +
  31 +# Install gems for MySQL
  32 +sudo -u gitlab -H bundle install --without development test postgres sqlite
  33 +
  34 +
  35 +# Migrate db
  36 +sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production
  37 +
  38 +
  39 +```
  40 +
  41 +### 3. Update post-receive hooks
  42 +
  43 +#### Gitolite 3
  44 +
  45 +Step 1: Rewrite post-receive hook
  46 +
  47 +```bash
  48 +# Rewrite hook for gitolite 3
  49 +sudo cp ./lib/hooks/post-receive /home/git/.gitolite/hooks/common/post-receive
  50 +sudo chown git:git /home/git/.gitolite/hooks/common/post-receive
  51 +```
  52 +
  53 +Step 2: Rewrite hooks in all projects to symlink gitolite hook
  54 +
  55 +```bash
  56 +# 1. Check for valid path
  57 +sudo -u gitlab -H vim lib/support/rewrite-hooks.sh
  58 +
  59 +# 2. Run script
  60 +sudo -u git -H lib/support/rewrite-hooks.sh
  61 +```
  62 +
  63 +#### Gitolite v2
  64 +
  65 +Step 1: rewrite post-receive hook for gitolite 2
  66 +
  67 +```
  68 +sudo cp ./lib/hooks/post-receive /home/git/share/gitolite/hooks/common/post-receive
  69 +sudo chown git:git /home/git/share/gitolite/hooks/common/post-receive
  70 +```
  71 +
  72 +Step 2: Replace symlinks in project to valid place
  73 +
  74 +
  75 + #!/bin/bash
  76 + src="/home/git/repositories"
  77 + for dir in `ls "$src/"`
  78 + do
  79 + if [ -d "$src/$dir" ]; then
  80 +
  81 + if [ "$dir" = "gitolite-admin.git" ]
  82 + then
  83 + continue
  84 + fi
  85 +
  86 + project_hook="$src/$dir/hooks/post-receive"
  87 + gitolite_hook="/home/git/share/gitolite/hooks/common/post-receive"
  88 +
  89 + ln -s -f $gitolite_hook $project_hook
  90 + fi
  91 + done
  92 +
  93 +
  94 +### 4. Check app status
  95 +
  96 +```bash
  97 +
  98 +# Check APP Status
  99 +sudo -u gitlab -H bundle exec rake gitlab:app:status RAILS_ENV=production
  100 +
  101 +
  102 +
  103 +```
  104 +
  105 +
  106 +### 5. Start all
  107 +
  108 + sudo service gitlab start
... ...
doc/update/3.1-to-4.0.md 0 → 100644
... ... @@ -0,0 +1,99 @@
  1 +# From 3.1 to 4.0
  2 +
  3 +## Important changes
  4 +
  5 +* Support for SQLite was dropped
  6 +* Support for gitolite 2 was dropped
  7 +* Projects are organized in namespaces
  8 +* The GitLab post-receive hook needs to be updated
  9 +* The configuration file needs to be updated
  10 +* Availability of `python2` executable
  11 +
  12 +Most of projects has post-receive file as symlink to gitolite `/home/git/.gitolite/hooks/post-receive`.
  13 +But some of them may have a real file. In this case you should rewrite it with symlink to gitolite hook.
  14 +
  15 +I wrote a bash script which will do it automatically for you. Just make sure all path inside is valid for you
  16 +
  17 +- - -
  18 +
  19 +### 1. Stop GitLab & Resque
  20 +
  21 + sudo service gitlab stop
  22 +
  23 +### 2. Update GitLab
  24 +
  25 +```bash
  26 +
  27 +# Get latest code
  28 +sudo -u gitlab -H git fetch
  29 +sudo -u gitlab -H git checkout 4-0-stable
  30 +
  31 +# Install gems for MySQL
  32 +sudo -u gitlab -H bundle install --without development test postgres
  33 +
  34 +# Update repos permissions
  35 +sudo chmod -R ug+rwXs /home/git/repositories/
  36 +sudo chown -R git:git /home/git/repositories/
  37 +
  38 +# Migrate db
  39 +sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production
  40 +
  41 +# Enable namespaces (**Warning!** All projects in groups will be moved to subdirectories)
  42 +sudo -u gitlab -H bundle exec rake gitlab:enable_namespaces RAILS_ENV=production
  43 +
  44 +```
  45 +
  46 +### 3. Update post-receive hooks (Requires gitolite v3 )
  47 +
  48 +
  49 +Step 1: Rewrite post-receive hook
  50 +
  51 +```bash
  52 +sudo cp ./lib/hooks/post-receive /home/git/.gitolite/hooks/common/post-receive
  53 +sudo chown git:git /home/git/.gitolite/hooks/common/post-receive
  54 +```
  55 +
  56 +Step 2: Update project hooks to be symlinks to the Gitolite hook
  57 +
  58 +```bash
  59 +# 1. Check paths in script
  60 +sudo -u gitlab -H vim lib/support/rewrite-hooks.sh
  61 +
  62 +# 2. Run script
  63 +sudo -u git -H lib/support/rewrite-hooks.sh
  64 +```
  65 +
  66 +
  67 +### 4. Replace config with new one
  68 +
  69 +
  70 + # backup old one
  71 + sudo -u gitlab -H cp config/gitlab.yml config/gitlab.yml.old
  72 +
  73 + # copy new one
  74 + sudo -u gitlab -H cp config/gitlab.yml.example config/gitlab.yml
  75 +
  76 + # edit it
  77 + sudo -u gitlab -H vim config/gitlab.yml
  78 +
  79 +
  80 +### 5. Disable ssh known_host check for own domain
  81 +
  82 +
  83 + echo "Host localhost
  84 + StrictHostKeyChecking no
  85 + UserKnownHostsFile=/dev/null" | sudo tee -a /etc/ssh/ssh_config
  86 +
  87 + echo "Host YOUR_DOMAIN_NAME
  88 + StrictHostKeyChecking no
  89 + UserKnownHostsFile=/dev/null" | sudo tee -a /etc/ssh/ssh_config
  90 +
  91 +
  92 +### 6. Check GitLab's status
  93 +
  94 + sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production
  95 +
  96 +
  97 +### 7. Start GitLab & Resque
  98 +
  99 + sudo service gitlab start
... ...
doc/update/4.0-to-4.1.md 0 → 100644
... ... @@ -0,0 +1,55 @@
  1 +# From 4.0 to 4.1
  2 +
  3 +## Important changes
  4 +
  5 +* Resque replaced with Sidekiq
  6 +* New options for configuration file added
  7 +* Init.d script should be updated
  8 +* __requires ruby1.9.3-p327__
  9 +
  10 +- - -
  11 +
  12 +### 1. Stop GitLab & Resque
  13 +
  14 + sudo service gitlab stop
  15 +
  16 +### 2. Update GitLab
  17 +
  18 +```bash
  19 +
  20 +# Get latest code
  21 +sudo -u gitlab -H git fetch
  22 +sudo -u gitlab -H git checkout 4-1-stable
  23 +
  24 +# Install gems for MySQL
  25 +sudo -u gitlab -H bundle install --without development test postgres
  26 +
  27 +# Migrate db
  28 +sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production
  29 +
  30 +```
  31 +
  32 +### 3. Replace init.d script with a new one
  33 +
  34 +```
  35 +# backup old one
  36 +sudo mv /etc/init.d/gitlab /etc/init.d/gitlab.old
  37 +
  38 +# get new one usign sidekiq
  39 +sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/4-1-stable/init.d/gitlab
  40 +sudo chmod +x /etc/init.d/gitlab
  41 +
  42 +```
  43 +
  44 +### 4. Check GitLab's status
  45 +
  46 + sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production
  47 +
  48 +
  49 +### 5. Start GitLab & Sidekiq
  50 +
  51 + sudo service gitlab start
  52 +
  53 +### 6. Remove old init.d script
  54 +
  55 + sudo rm /etc/init.d/gitlab.old
... ...
doc/update/4.1-to-4.2.md 0 → 100644
... ... @@ -0,0 +1,34 @@
  1 +# From 4.1 to 4.2
  2 +
  3 +### 1. Stop server & resque
  4 +
  5 + sudo service gitlab stop
  6 +
  7 +### 2. Update code & db
  8 +
  9 +```bash
  10 +# Get latest code
  11 +sudo -u gitlab git fetch
  12 +
  13 +sudo -u gitlab git checkout 4-2-stable
  14 +
  15 +# Install libs
  16 +sudo -u gitlab bundle install --without development test postgres --deployment
  17 +
  18 +# update db
  19 +sudo -u gitlab bundle exec rake db:migrate RAILS_ENV=production
  20 +
  21 +```
  22 +
  23 +
  24 +### 3. Check GitLab's status
  25 +
  26 +```bash
  27 +sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production
  28 +```
  29 +
  30 +
  31 +
  32 +### 4. Start all
  33 +
  34 + sudo service gitlab start
... ...