diff --git a/Gemfile.lock b/Gemfile.lock index 313d2ffbca56596f468d3e88706f4c6687963e30..a6af92bd9ac23159e40c9b1424a403c13d017d28 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) diff --git a/app/assets/javascripts/main.js.coffee b/app/assets/javascripts/main.js.coffee index fd7e296efdec42baf552c3ec4661ba4c01c903e7..2cdc705c22ee652946b2f9e2404758163249f5cf 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) -> diff --git a/config/initializers/connection_fix.rb b/config/initializers/connection_fix.rb deleted file mode 100644 index 16cb69ca68bc6860520d79ce13f0a075cf97ee62..0000000000000000000000000000000000000000 --- 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 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 0000000000000000000000000000000000000000..764312d0986df254921a05dd64a557a8965a3a4c --- /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 diff --git a/lib/support/init.d/gitlab b/lib/support/init.d/gitlab index f4ca07b36765700583c9a3a58ebb0ea005adc4c3..faab0743168cd679943d0e6a82da398c788fe95b 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