From 5c74c31484d48bc1c8a9867d89e0c433d574b257 Mon Sep 17 00:00:00 2001 From: Robert Schilling <rschilling@student.tugraz.at> Date: Sat, 22 Jun 2013 13:34:34 +0200 Subject: [PATCH 1/5] Add fixed update docs --- doc/update/5.2-to-5.3.md | 80 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 doc/update/5.2-to-5.3.md diff --git a/doc/update/5.2-to-5.3.md b/doc/update/5.2-to-5.3.md new file mode 100644 index 00000000000..764312d0986 --- /dev/null +++ b/doc/update/5.2-to-5.3.md @@ -0,0 +1,80 @@ +# From 5.2 to 5.3 + +### 0. Backup + +It's useful to make a backup just in case things go south: +(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version) + +```bash +cd /home/git/gitlab +sudo -u git -H RAILS_ENV=production bundle exec rake gitlab:backup:create +``` + +### 1. Stop server + + sudo service gitlab stop + +### 2. Get latest code + +```bash +cd /home/git/gitlab +sudo -u git -H git fetch +sudo -u git -H git checkout 5-3-stable +``` + +### 3. Install libs, migrations, etc. + +```bash +cd /home/git/gitlab + +# MySQL +sudo -u git -H bundle install --without development test postgres --deployment + +#PostgreSQL +sudo -u git -H bundle install --without development test mysql --deployment + +sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production +``` + +### 4. Update config files + +* Make `/home/git/gitlab/config/gitlab.yml` same as https://github.com/gitlabhq/gitlabhq/blob/5-3-stable/config/gitlab.yml.example but with your settings. +* Make `/home/git/gitlab/config/puma.rb` same as https://github.com/gitlabhq/gitlabhq/blob/5-3-stable/config/puma.rb.example but with your settings. + +### 5. Update Init script + +```bash +sudo rm /etc/init.d/gitlab +sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/5-3-stable/lib/support/init.d/gitlab +sudo chmod +x /etc/init.d/gitlab +``` + +### 6. Start application + + sudo service gitlab start + sudo service nginx restart + +### 7. Check application status + +Check if GitLab and its environment are configured correctly: + + sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production + +To make sure you didn't miss anything run a more thorough check with: + + sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production + +If all items are green, then congratulations upgrade complete! + +## Things went south? Revert to previous version (5.2) + +### 1. Revert the code to the previous version +Follow the [`upgrade guide from 5.1 to 5.2`](5.1-to-5.2.md), except for the database migration +(The backup is already migrated to the previous version) + +### 2. Restore from the backup: + +```bash +cd /home/git/gitlab +sudo -u git -H RAILS_ENV=production bundle exec rake gitlab:backup:restore +``` \ No newline at end of file -- GitLab From ff2af99ca796bab3b780d2263e7255b2a02db103 Mon Sep 17 00:00:00 2001 From: Martin Lauer <martin.lauer@b13.de> Date: Tue, 25 Jun 2013 14:32:52 +0200 Subject: [PATCH 2/5] raise App Version to stable Branch 5.3 --- lib/support/init.d/gitlab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/support/init.d/gitlab b/lib/support/init.d/gitlab index f4ca07b3676..faab0743168 100644 --- a/lib/support/init.d/gitlab +++ b/lib/support/init.d/gitlab @@ -2,7 +2,7 @@ # GITLAB # Maintainer: @randx -# App Version: 5.2 +# App Version: 5.3 ### BEGIN INIT INFO # Provides: gitlab -- GitLab From 04afcbd873e7d3175d94130b81705f63fbfda17a Mon Sep 17 00:00:00 2001 From: Izaak Alpert <ialpert@blackberry.com> Date: Thu, 4 Jul 2013 12:00:34 -0400 Subject: [PATCH 3/5] Updated sidekiq Gemfile.lock for celluloid error Should (hopefully fix issue with: "Mysql2::Error: This connection is still waiting for a result, try again once you have the result:" https://github.com/mperham/sidekiq/pull/954 https://github.com/celluloid/celluloid/pull/268 Change-Id: I4daa65b6b6f9de20975d95ba07ffab103ec03204 --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 313d2ffbca5..a6af92bd9ac 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -67,7 +67,7 @@ GEM carrierwave (0.8.0) activemodel (>= 3.2.0) activesupport (>= 3.2.0) - celluloid (0.14.0) + celluloid (0.14.1) timers (>= 1.0.0) charlock_holmes (0.6.9.4) childprocess (0.3.9) @@ -87,7 +87,7 @@ GEM coffee-script-source (1.6.2) colored (1.2) colorize (0.5.8) - connection_pool (1.0.0) + connection_pool (1.1.0) coveralls (0.6.7) colorize multi_json (~> 1.3) @@ -428,8 +428,8 @@ GEM sexp_processor (4.2.1) shoulda-matchers (2.1.0) activesupport (>= 3.0.0) - sidekiq (2.12.0) - celluloid (>= 0.14.0) + sidekiq (2.12.4) + celluloid (>= 0.14.1) connection_pool (>= 1.0.0) json redis (>= 3.0) -- GitLab From 13dc1a896bfaa1fce4d95776f4c47e9313141231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20M=C3=B6rchen?= <gitlab.euve@rest.scrobble.me> Date: Tue, 9 Jul 2013 12:56:43 +0200 Subject: [PATCH 4/5] Increased flash timeout to 15 seconds --- app/assets/javascripts/main.js.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/main.js.coffee b/app/assets/javascripts/main.js.coffee index fd7e296efde..2cdc705c22e 100644 --- a/app/assets/javascripts/main.js.coffee +++ b/app/assets/javascripts/main.js.coffee @@ -86,7 +86,7 @@ $ -> if (flash = $(".flash-container")).length > 0 flash.click -> $(@).fadeOut() flash.show() - setTimeout (-> flash.fadeOut()), 3000 + setTimeout (-> flash.fadeOut()), 15000 # Disable form buttons while a form is submitting $('body').on 'ajax:complete, ajax:beforeSend, submit', 'form', (e) -> -- GitLab From d4ad9643be8a3fbe999db98373f8d924e4f413ab Mon Sep 17 00:00:00 2001 From: Sytse Sijbrandij <sytse@dosire.com> Date: Sat, 10 Aug 2013 16:20:33 +0200 Subject: [PATCH 5/5] Fix for Resque forking might cause stuck workers for the threaded Sidekiq. --- config/initializers/connection_fix.rb | 36 --------------------------- 1 file changed, 36 deletions(-) delete mode 100644 config/initializers/connection_fix.rb diff --git a/config/initializers/connection_fix.rb b/config/initializers/connection_fix.rb deleted file mode 100644 index 16cb69ca68b..00000000000 --- a/config/initializers/connection_fix.rb +++ /dev/null @@ -1,36 +0,0 @@ -# from http://gist.github.com/238999 -# -# If your workers are inactive for a long period of time, they'll lose -# their MySQL connection. -# -# This hack ensures we re-connect whenever a connection is -# lost. Because, really. why not? -# -# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar) -# -# From: -# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/ - -if defined?(ActiveRecord::ConnectionAdapters::Mysql2Adapter) - - module ActiveRecord::ConnectionAdapters - - class Mysql2Adapter - alias_method :execute_without_retry, :execute - - def execute(*args) - execute_without_retry(*args) - rescue ActiveRecord::StatementInvalid => e - if e.message =~ /server has gone away/i - warn "Server timed out, retrying" - reconnect! - retry - else - raise e - end - end - end - - end - -end -- GitLab