diff --git a/.travis.yml b/.travis.yml index a98d6fa..e75d84d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,21 @@ sudo: required -language: ruby + +language: minimal + services: -- docker -rvm: -- 2.4.4 + - docker + +addons: + apt: + packages: + - docker-ce + env: -- DB=sqlite + - DOCKER_COMPOSE_VERSION=1.22.0 + script: -- bash bin/run-tests-with-docker.sh + - bash bin/run-tests-with-docker.sh + deploy: provider: heroku api_key: diff --git a/Gemfile b/Gemfile index 320b4d2..48e0e1c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,8 @@ source 'https://rubygems.org' -ruby '2.4.4' +ruby '2.5.1' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '5.1.6' +gem 'rails', '5.2.1' # Use sqlite3 as the database for Active Record gem 'sqlite3', :group => :development diff --git a/Gemfile.lock b/Gemfile.lock index 7ffd591..25d8381 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,51 +1,55 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.1.6) - actionpack (= 5.1.6) + actioncable (5.2.1) + actionpack (= 5.2.1) nio4r (~> 2.0) - websocket-driver (~> 0.6.1) - actionmailer (5.1.6) - actionpack (= 5.1.6) - actionview (= 5.1.6) - activejob (= 5.1.6) + websocket-driver (>= 0.6.1) + actionmailer (5.2.1) + actionpack (= 5.2.1) + actionview (= 5.2.1) + activejob (= 5.2.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.1.6) - actionview (= 5.1.6) - activesupport (= 5.1.6) + actionpack (5.2.1) + actionview (= 5.2.1) + activesupport (= 5.2.1) rack (~> 2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.1.6) - activesupport (= 5.1.6) + actionview (5.2.1) + activesupport (= 5.2.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.1.6) - activesupport (= 5.1.6) + activejob (5.2.1) + activesupport (= 5.2.1) globalid (>= 0.3.6) - activemodel (5.1.6) - activesupport (= 5.1.6) - activerecord (5.1.6) - activemodel (= 5.1.6) - activesupport (= 5.1.6) - arel (~> 8.0) - activesupport (5.1.6) + activemodel (5.2.1) + activesupport (= 5.2.1) + activerecord (5.2.1) + activemodel (= 5.2.1) + activesupport (= 5.2.1) + arel (>= 9.0) + activestorage (5.2.1) + actionpack (= 5.2.1) + activerecord (= 5.2.1) + marcel (~> 0.3.1) + activesupport (5.2.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) addressable (2.4.0) - arel (8.0.0) + arel (9.0.0) ast (2.4.0) backports (3.11.3) bcrypt (3.1.12) brakeman (4.3.1) builder (3.2.3) - bullet (5.7.5) + bullet (5.7.6) activesupport (>= 3.0.0) uniform_notifier (~> 1.11.0) cancancan (2.2.0) @@ -67,7 +71,7 @@ GEM delayed_job_active_record (4.1.3) activerecord (>= 3.0, < 5.3) delayed_job (>= 3.0, < 5) - devise (4.4.3) + devise (4.5.0) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0, < 6.0) @@ -105,7 +109,7 @@ GEM highline (1.7.10) http-cookie (1.0.3) domain_name (~> 0.5) - i18n (1.0.1) + i18n (1.1.0) concurrent-ruby (~> 1.0) jaro_winkler (1.5.1) jbuilder (2.7.0) @@ -124,11 +128,14 @@ GEM nokogiri (>= 1.5.9) mail (2.7.0) mini_mime (>= 0.1.1) + marcel (0.3.2) + mimemagic (~> 0.3.2) method_source (0.9.0) - mime-types (3.1) + mime-types (3.2.2) mime-types-data (~> 3.2015) - mime-types-data (3.2016.0521) - mini_mime (1.0.0) + mime-types-data (3.2018.0812) + mimemagic (0.3.2) + mini_mime (1.0.1) mini_portile2 (2.3.0) minitest (5.11.3) multi_json (1.13.1) @@ -156,17 +163,18 @@ GEM rack (2.0.5) rack-test (1.1.0) rack (>= 1.0, < 3) - rails (5.1.6) - actioncable (= 5.1.6) - actionmailer (= 5.1.6) - actionpack (= 5.1.6) - actionview (= 5.1.6) - activejob (= 5.1.6) - activemodel (= 5.1.6) - activerecord (= 5.1.6) - activesupport (= 5.1.6) + rails (5.2.1) + actioncable (= 5.2.1) + actionmailer (= 5.2.1) + actionpack (= 5.2.1) + actionview (= 5.2.1) + activejob (= 5.2.1) + activemodel (= 5.2.1) + activerecord (= 5.2.1) + activestorage (= 5.2.1) + activesupport (= 5.2.1) bundler (>= 1.3.0) - railties (= 5.1.6) + railties (= 5.2.1) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) @@ -178,12 +186,12 @@ GEM rails_stdout_logging rails_serve_static_assets (0.0.5) rails_stdout_logging (0.0.5) - railties (5.1.6) - actionpack (= 5.1.6) - activesupport (= 5.1.6) + railties (5.2.1) + actionpack (= 5.2.1) + activesupport (= 5.2.1) method_source rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) + thor (>= 0.19.0, < 2.0) rainbow (3.0.0) rake (12.3.1) rb-readline (0.5.5) @@ -205,7 +213,7 @@ GEM rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) - ruby-progressbar (1.9.0) + ruby-progressbar (1.10.0) sdoc (1.0.0) rdoc (>= 5.0) spring (2.0.2) @@ -225,7 +233,7 @@ GEM ref thor (0.20.0) thread_safe (0.3.6) - travis (1.8.8) + travis (1.8.9) backports faraday (~> 0.9) faraday_middleware (~> 0.9, >= 0.9.1) @@ -234,16 +242,16 @@ GEM launchy (~> 2.1) pusher-client (~> 0.4) typhoeus (~> 0.6, >= 0.6.8) - turbolinks (5.1.1) - turbolinks-source (~> 5.1) - turbolinks-source (5.1.0) + turbolinks (5.2.0) + turbolinks-source (~> 5.2) + turbolinks-source (5.2.0) typhoeus (0.8.0) ethon (>= 0.8.0) tzinfo (1.2.5) thread_safe (~> 0.1) tzinfo-data (1.2018.5) tzinfo (>= 1.0.0) - uglifier (4.1.17) + uglifier (4.1.18) execjs (>= 0.3.0, < 3) unf (0.1.4) unf_ext @@ -253,7 +261,7 @@ GEM warden (1.2.7) rack (>= 1.0) websocket (1.2.8) - websocket-driver (0.6.5) + websocket-driver (0.7.0) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.3) @@ -276,7 +284,7 @@ DEPENDENCIES newrelic_rpm passenger puma - rails (= 5.1.6) + rails (= 5.2.1) rails_12factor rb-readline round_robin_tournament @@ -291,7 +299,7 @@ DEPENDENCIES uglifier RUBY VERSION - ruby 2.4.4p296 + ruby 2.5.1p57 BUNDLED WITH 1.16.2 diff --git a/Procfile b/Procfile index d7674de..23cb4f3 100644 --- a/Procfile +++ b/Procfile @@ -1,3 +1,4 @@ -worker: bundle exec rake jobs:work -web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development} +worker: bundle exec bin/delayed_job -n 1 run +#worker: bundle exec rake jobs:work +web: bundle exec puma -w 3 -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development} #web: bundle exec passenger start -p $PORT --max-pool-size 3 diff --git a/deploy/docker-compose-prod-full-stack.yml b/deploy/docker-compose-prod-full-stack.yml index f7702cc..48e5be2 100644 --- a/deploy/docker-compose-prod-full-stack.yml +++ b/deploy/docker-compose-prod-full-stack.yml @@ -1,4 +1,4 @@ -version: "3.3" +version: "2.2" networks: database: caching: diff --git a/deploy/docker-compose-test.yml b/deploy/docker-compose-test.yml index 35ed9b2..b2c8355 100644 --- a/deploy/docker-compose-test.yml +++ b/deploy/docker-compose-test.yml @@ -1,4 +1,4 @@ -version: "3.3" +version: "2.2" networks: database: caching: @@ -31,14 +31,6 @@ services: ports: - "80:80" - "443:443" - deploy: - resources: - limits: - cpus: '0.25' - memory: 512M - reservations: - cpus: '0.25' - memory: 256M healthcheck: test: curl --insecure https://127.0.0.1/ @@ -53,14 +45,6 @@ services: restart: always networks: database: - deploy: - resources: - limits: - cpus: '0.25' - memory: 512M - reservations: - cpus: '0.25' - memory: 256M worker: image: wrestlingdev @@ -83,25 +67,10 @@ services: healthcheck: test: kill -0 1 command: bundle exec bin/delayed_job -n 1 run - deploy: - resources: - limits: - cpus: '0.25' - memory: 512M - reservations: - cpus: '0.25' - memory: 256M memcached: image: memcached:1.5 - deploy: - resources: - limits: - cpus: '0.10' - memory: 64M - reservations: - cpus: '0.10' - memory: 64M + mem_limit: 64000000 restart: always networks: caching: diff --git a/deploy/rails-dev-Dockerfile b/deploy/rails-dev-Dockerfile index 003244d..1202443 100644 --- a/deploy/rails-dev-Dockerfile +++ b/deploy/rails-dev-Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.4.4 +FROM ruby:2.5.1 RUN apt-get -qq update \ && apt-get -qq install -y \ diff --git a/deploy/rails-prod-Dockerfile b/deploy/rails-prod-Dockerfile index f866048..1a5a659 100644 --- a/deploy/rails-prod-Dockerfile +++ b/deploy/rails-prod-Dockerfile @@ -2,8 +2,7 @@ FROM ubuntu:xenial HEALTHCHECK --start-period=30s CMD curl --insecure https://127.0.0.1/ -ENV RUBY_VERSION=2.4.4 -ENV RUBY_MAJOR_VERSION=2.4 +ENV RUBY_VERSION=2.5.1 ENV TINI_VERSION v0.18.0 ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini @@ -37,7 +36,7 @@ RUN apt-get -qq update \ lsb-release \ dirmngr \ gnupg \ - && wget http://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR_VERSION}/ruby-${RUBY_VERSION}.tar.gz \ + && wget http://cache.ruby-lang.org/pub/ruby/$(echo $RUBY_VERSION | cut -d '.' -f 1,2)/ruby-${RUBY_VERSION}.tar.gz \ && tar -xzf ruby-${RUBY_VERSION}.tar.gz \ && cd ruby-${RUBY_VERSION} \ && ./configure \ @@ -90,5 +89,5 @@ RUN RAILS_ENV=production bundle exec rake assets:precompile ENTRYPOINT ["/tini", "--"] WORKDIR /rails -CMD bundle exec puma -t 5:5 -b 'ssl://0.0.0.0:443?key=/ssl/server.key&verify_mode=none&cert=/ssl/server.crt' -e production +CMD bundle exec puma -w 3 -t 5:5 -b 'ssl://0.0.0.0:443?key=/ssl/server.key&verify_mode=none&cert=/ssl/server.crt' -e production #CMD bundle exec passenger start --max-pool-size 3 --environment production --ssl --ssl-certificate /ssl/server.crt --ssl-certificate-key /ssl/server.key