From db69e5dccb99f81798285e541fa4f8bfec6c9440 Mon Sep 17 00:00:00 2001 From: Rien Maertens Date: Tue, 7 Aug 2018 23:02:17 +0200 Subject: [PATCH 1/3] Use Ruby 2.4.0 and deploy to herbert --- .gitignore | 1 + .ruby-version | 2 +- Gemfile | 28 +++--- Gemfile.lock | 146 +++++++++++++++------------- app/views/layouts/_header.html.haml | 2 +- config/deploy.rb | 2 +- config/deploy/production.rb | 2 +- config/environments/production.rb | 11 +-- 8 files changed, 98 insertions(+), 96 deletions(-) diff --git a/.gitignore b/.gitignore index d4e179b..89514d9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ # If you find yourself ignoring temporary files generated by your text editor # or operating system, you probably want to add a global ignore instead: # git config --global core.excludesfile '~/.gitignore_global' +.byebug_history # Ignore bundler config. /.bundle diff --git a/.ruby-version b/.ruby-version index d64a644..197c4d5 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.0-dev +2.4.0 diff --git a/Gemfile b/Gemfile index b4fecfd..28202eb 100644 --- a/Gemfile +++ b/Gemfile @@ -1,19 +1,21 @@ source 'https://rubygems.org' +gem 'byebug' + # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '4.2.4' +gem 'rails', '4.2.10' # Assets gem 'sass-rails', '~> 4.0.3' gem 'bootstrap-sass', '3.2.0.0' -gem 'bootstrap-switch-rails' +gem 'bootstrap-switch-rails', '3.3.3' gem 'uglifier', '>= 1.3.0' -gem 'jquery-rails' +gem 'jquery-rails', '4.1.0' # Haml for templating! gem "haml-rails", "~> 0.9" # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks -gem 'turbolinks' +gem 'turbolinks', '2.5.3' # Friendly ids! gem 'friendly_id', '~> 5.1.0' @@ -35,12 +37,12 @@ end group :development do # Use sqlite3 as the database for Active Record - gem 'sqlite3' + gem 'sqlite3', '1.3.11' gem 'annotate' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring - gem 'spring' + gem 'spring', '1.6.2' # Deployment gem 'capistrano', '~> 3.1' @@ -51,7 +53,7 @@ group :development do end group :development, :test do - gem 'factory_girl_rails' + gem 'factory_girl_rails', '4.6.0' gem 'faker', '1.4.2' end @@ -63,21 +65,21 @@ gem 'will_paginate', '3.0.7' gem 'bootstrap-will_paginate', '0.0.10' # Paperclip for easy file attachment -gem 'paperclip' +gem 'paperclip', '4.3.4' # Use devise for users and admins -gem 'devise' +gem 'devise', '3.5.6' gem 'omniauth-oauth2', '1.3.1' # Use cancancan for authorization -gem 'cancancan' +gem 'cancancan', '1.13.1' # Default avatar for users -gem 'identicon' +gem 'identicon', '0.0.5' # Run stuff in the background -gem 'daemons' +gem 'daemons', '1.2.3' gem 'delayed_job', '~> 4.0' gem 'delayed_job_active_record' -gem 'httparty' +gem 'httparty', '0.13.7' diff --git a/Gemfile.lock b/Gemfile.lock index f52bd57..567887b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,38 +1,37 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.4) - actionpack (= 4.2.4) - actionview (= 4.2.4) - activejob (= 4.2.4) + actionmailer (4.2.10) + actionpack (= 4.2.10) + actionview (= 4.2.10) + activejob (= 4.2.10) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.4) - actionview (= 4.2.4) - activesupport (= 4.2.4) + actionpack (4.2.10) + actionview (= 4.2.10) + activesupport (= 4.2.10) rack (~> 1.6) rack-test (~> 0.6.2) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.4) - activesupport (= 4.2.4) + actionview (4.2.10) + activesupport (= 4.2.10) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - activejob (4.2.4) - activesupport (= 4.2.4) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (4.2.10) + activesupport (= 4.2.10) globalid (>= 0.3.0) - activemodel (4.2.4) - activesupport (= 4.2.4) + activemodel (4.2.10) + activesupport (= 4.2.10) builder (~> 3.1) - activerecord (4.2.4) - activemodel (= 4.2.4) - activesupport (= 4.2.4) + activerecord (4.2.10) + activemodel (= 4.2.10) + activesupport (= 4.2.10) arel (~> 6.0) - activesupport (4.2.4) + activesupport (4.2.10) i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) @@ -43,14 +42,15 @@ GEM annotate (2.7.0) activerecord (>= 3.2, < 6.0) rake (~> 10.4) - arel (6.0.3) + arel (6.0.4) bcrypt (3.1.10) bootstrap-sass (3.2.0.0) sass (~> 3.2) bootstrap-switch-rails (3.3.3) bootstrap-will_paginate (0.0.10) will_paginate - builder (3.2.2) + builder (3.2.3) + byebug (10.0.2) cancancan (1.13.1) capistrano (3.4.0) i18n @@ -84,6 +84,7 @@ GEM coffee-script-source execjs coffee-script-source (1.10.0) + concurrent-ruby (1.0.5) coveralls (0.8.10) json (~> 1.8) rest-client (>= 1.6.8, < 2) @@ -93,6 +94,7 @@ GEM tins (~> 1.6.0) crack (0.4.3) safe_yaml (~> 1.0.0) + crass (1.0.4) daemons (1.2.3) delayed_job (4.1.1) activesupport (>= 3.0, < 5.0) @@ -123,8 +125,8 @@ GEM multipart-post (>= 1.2, < 3) friendly_id (5.1.0) activerecord (>= 4.0.0) - globalid (0.3.6) - activesupport (>= 4.1.0) + globalid (0.4.1) + activesupport (>= 4.2.0) haml (4.0.7) tilt haml-rails (0.9.0) @@ -146,24 +148,27 @@ GEM httparty (0.13.7) json (~> 1.8) multi_xml (>= 0.5.2) - i18n (0.7.0) + i18n (0.9.5) + concurrent-ruby (~> 1.0) identicon (0.0.5) chunky_png jquery-rails (4.1.0) rails-dom-testing (~> 1.0) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (1.8.3) + json (1.8.6) jwt (1.5.1) - loofah (2.0.3) + loofah (2.2.2) + crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.6.3) - mime-types (>= 1.16, < 3) - mime-types (2.99) + mail (2.7.0) + mini_mime (>= 0.1.1) + mime-types (2.99.3) mimemagic (0.3.0) - mini_portile2 (2.0.0) - minitest (5.8.4) - multi_json (1.11.2) + mini_mime (1.0.0) + mini_portile2 (2.1.0) + minitest (5.11.3) + multi_json (1.13.1) multi_xml (0.5.5) multipart-post (2.0.0) mysql2 (0.3.20) @@ -171,8 +176,8 @@ GEM net-ssh (>= 2.6.5) net-ssh (3.0.2) netrc (0.11.0) - nokogiri (1.6.7.2) - mini_portile2 (~> 2.0.0.rc2) + nokogiri (1.6.8.1) + mini_portile2 (~> 2.1.0) oauth2 (1.1.0) faraday (>= 0.8, < 0.10) jwt (~> 1.0, < 1.5.2) @@ -192,31 +197,31 @@ GEM cocaine (~> 0.5.5) mime-types mimemagic (= 0.3.0) - rack (1.6.4) + rack (1.6.10) rack-test (0.6.3) rack (>= 1.0) - rails (4.2.4) - actionmailer (= 4.2.4) - actionpack (= 4.2.4) - actionview (= 4.2.4) - activejob (= 4.2.4) - activemodel (= 4.2.4) - activerecord (= 4.2.4) - activesupport (= 4.2.4) + rails (4.2.10) + actionmailer (= 4.2.10) + actionpack (= 4.2.10) + actionview (= 4.2.10) + activejob (= 4.2.10) + activemodel (= 4.2.10) + activerecord (= 4.2.10) + activesupport (= 4.2.10) bundler (>= 1.3.0, < 2.0) - railties (= 4.2.4) + railties (= 4.2.10) sprockets-rails rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.7) - activesupport (>= 4.2.0.beta, < 5.0) - nokogiri (~> 1.6.0) + rails-dom-testing (1.0.9) + activesupport (>= 4.2.0, < 5.0) + nokogiri (~> 1.6) rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.0.3) - loofah (~> 2.0) - railties (4.2.4) - actionpack (= 4.2.4) - activesupport (= 4.2.4) + rails-html-sanitizer (1.0.4) + loofah (~> 2.2, >= 2.2.2) + railties (4.2.10) + actionpack (= 4.2.10) + activesupport (= 4.2.10) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rake (10.5.0) @@ -264,7 +269,7 @@ GEM simplecov-html (~> 0.10.0) simplecov-html (0.10.0) spring (1.6.2) - sprockets (2.12.4) + sprockets (2.12.5) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) @@ -279,13 +284,13 @@ GEM net-ssh (>= 2.8.0) term-ansicolor (1.3.2) tins (~> 1.0) - thor (0.19.1) - thread_safe (0.3.5) + thor (0.19.4) + thread_safe (0.3.6) tilt (1.4.1) tins (1.6.0) turbolinks (2.5.3) coffee-rails - tzinfo (1.2.2) + tzinfo (1.2.5) thread_safe (~> 0.1) uglifier (2.7.2) execjs (>= 0.3.0) @@ -308,9 +313,10 @@ DEPENDENCIES airbrake (~> 4) annotate bootstrap-sass (= 3.2.0.0) - bootstrap-switch-rails + bootstrap-switch-rails (= 3.3.3) bootstrap-will_paginate (= 0.0.10) - cancancan + byebug + cancancan (= 1.13.1) capistrano (~> 3.1) capistrano-passenger capistrano-rails (~> 1.1) @@ -318,30 +324,30 @@ DEPENDENCIES capistrano-rvm codeclimate-test-reporter coveralls - daemons + daemons (= 1.2.3) delayed_job (~> 4.0) delayed_job_active_record - devise - factory_girl_rails + devise (= 3.5.6) + factory_girl_rails (= 4.6.0) faker (= 1.4.2) friendly_id (~> 5.1.0) haml-rails (~> 0.9) - httparty - identicon - jquery-rails + httparty (= 0.13.7) + identicon (= 0.0.5) + jquery-rails (= 4.1.0) mysql2 (~> 0.3.18) omniauth-oauth2 (= 1.3.1) - paperclip - rails (= 4.2.4) + paperclip (= 4.3.4) + rails (= 4.2.10) rspec-rails sass-rails (~> 4.0.3) sdoc (~> 0.4.0) - spring - sqlite3 - turbolinks + spring (= 1.6.2) + sqlite3 (= 1.3.11) + turbolinks (= 2.5.3) uglifier (>= 1.3.0) webmock will_paginate (= 3.0.7) BUNDLED WITH - 1.11.2 + 1.16.1 diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index fc714df..3d2924e 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -28,6 +28,6 @@ %li %p.navbar-text Balance: - = link_to euro_from_cents(current_user.balance), "https://zeus.ugent.be/tab/users/#{current_user.name}" + = link_to euro_from_cents(current_user.balance), "https://tab.zeus.gent/users/#{current_user.name}" .visible-xs.navbar-form = render 'layouts/session_button' diff --git a/config/deploy.rb b/config/deploy.rb index 3f1968a..64c1365 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -4,7 +4,7 @@ set :application, 'Tap' set :repo_url, 'git@github.com:ZeusWPI/Tap.git' -set :branch, 'master' +set :branch, 'fix-tap-on-herbert' set :deploy_to, '/home/tap/production' # Default branch is :master diff --git a/config/deploy/production.rb b/config/deploy/production.rb index 18ef671..18b89c1 100644 --- a/config/deploy/production.rb +++ b/config/deploy/production.rb @@ -1,4 +1,4 @@ -server 'zeus.ugent.be', user: 'tap', roles: %w{web app db}, ssh_options: { +server 'tap.ugent.be', user: 'tap', roles: %w{web app db}, ssh_options: { forward_agent: true, auth_methods: ['publickey'], port: 2222 diff --git a/config/environments/production.rb b/config/environments/production.rb index a59f0bd..26dea7e 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -79,13 +79,6 @@ Rails.application.configure do Paperclip.options[:command_path] = "/usr/local/bin/" # Help the asset pipeline for staging - config.x.host = 'zeus.ugent.be' - config.relative_url_root = "/tap" - - config.action_mailer.default_url_options = { - host: config.x.host, - script_name: config.relative_url_root, - } - - config.api_url = "https://zeus.ugent.be/tab" + config.x.host = 'tab.zeus.gent' + config.api_url = "https://tab.zeus.gent/" end From 32e29777397ace9c1f8980d279a52686a26d4389 Mon Sep 17 00:00:00 2001 From: Rien Maertens Date: Wed, 8 Aug 2018 00:24:39 +0200 Subject: [PATCH 2/3] Fix deploying on herbert --- Gemfile | 2 +- Gemfile.lock | 13 ++++++++----- config/deploy/production.rb | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 28202eb..2743505 100644 --- a/Gemfile +++ b/Gemfile @@ -45,7 +45,7 @@ group :development do gem 'spring', '1.6.2' # Deployment - gem 'capistrano', '~> 3.1' + gem 'capistrano', '~> 3.4' gem 'capistrano-rails', '~> 1.1' gem 'capistrano-rvm' gem 'capistrano-rbenv' diff --git a/Gemfile.lock b/Gemfile.lock index 567887b..0de3561 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -39,6 +39,8 @@ GEM airbrake (4.3.5) builder multi_json + airbrussh (1.3.0) + sshkit (>= 1.6.1, != 1.7.0) annotate (2.7.0) activerecord (>= 3.2, < 6.0) rake (~> 10.4) @@ -52,10 +54,11 @@ GEM builder (3.2.3) byebug (10.0.2) cancancan (1.13.1) - capistrano (3.4.0) + capistrano (3.11.0) + airbrussh (>= 1.0.0) i18n rake (>= 10.0.0) - sshkit (~> 1.3) + sshkit (>= 1.9.0) capistrano-bundler (1.1.4) capistrano (~> 3.1) sshkit (~> 1.2) @@ -174,7 +177,7 @@ GEM mysql2 (0.3.20) net-scp (1.2.1) net-ssh (>= 2.6.5) - net-ssh (3.0.2) + net-ssh (5.0.2) netrc (0.11.0) nokogiri (1.6.8.1) mini_portile2 (~> 2.1.0) @@ -279,7 +282,7 @@ GEM activesupport (>= 3.0) sprockets (>= 2.8, < 4.0) sqlite3 (1.3.11) - sshkit (1.8.1) + sshkit (1.17.0) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) term-ansicolor (1.3.2) @@ -317,7 +320,7 @@ DEPENDENCIES bootstrap-will_paginate (= 0.0.10) byebug cancancan (= 1.13.1) - capistrano (~> 3.1) + capistrano (~> 3.4) capistrano-passenger capistrano-rails (~> 1.1) capistrano-rbenv diff --git a/config/deploy/production.rb b/config/deploy/production.rb index 18b89c1..3fde857 100644 --- a/config/deploy/production.rb +++ b/config/deploy/production.rb @@ -1,4 +1,4 @@ -server 'tap.ugent.be', user: 'tap', roles: %w{web app db}, ssh_options: { +server 'tap.zeus.gent', user: 'tap', roles: %w{web app db}, ssh_options: { forward_agent: true, auth_methods: ['publickey'], port: 2222 From 171963ce67b69dea84d6b167356274202e0a3d06 Mon Sep 17 00:00:00 2001 From: Robbe Van Herck Date: Fri, 18 May 2018 01:03:12 +0200 Subject: [PATCH 3/3] Added installation instructions to README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 1e6e61d..4624dbb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ # [Tap](https://zeus.ugent.be/tap) [![Code Climate](https://codeclimate.com/github/ZeusWPI/Tap/badges/gpa.svg)](https://codeclimate.com/github/ZeusWPI/Tap) [![Travis CI](https://travis-ci.org/ZeusWPI/Tap.svg)](https://travis-ci.org/ZeusWPI/Tap) [![Coverage Status](https://coveralls.io/repos/ZeusWPI/Tap/badge.svg?branch=master&service=github)](https://coveralls.io/github/ZeusWPI/Tap?branch=master) Yes. We have to drink. But we also have to pay. This is the drinking part. + +## Installation +1. Make sure Ruby version 2.3.0-dev is installed by running `rbenv version`. If it isn't, install by running `rbenv install 2.3.0-dev` +2. Run `bundle update` and `bundle install` +3. Start Tap by running `bundle exec rails s`