diff --git a/Gemfile b/Gemfile index 638c83e..21bcd48 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,6 @@ source 'https://rubygems.org' +ruby '2.3.0' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.2.5' # Use sqlite3 as the database for Active Record @@ -54,7 +55,7 @@ gem 'spring', :group => :development gem 'rb-readline' gem 'delayed_job_active_record' gem 'puma' - gem 'postmark-rails' + gem 'brakeman' group :development do #gem 'bullet' diff --git a/Gemfile.lock b/Gemfile.lock index 973a2e6..e6c97cb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -38,6 +38,18 @@ GEM tzinfo (~> 1.1) arel (6.0.3) bcrypt (3.1.10) + brakeman (3.1.5) + erubis (~> 2.6) + fastercsv (~> 1.5) + haml (>= 3.0, < 5.0) + highline (>= 1.6.20, < 2.0) + multi_json (~> 1.2) + ruby2ruby (>= 2.1.1, < 2.3.0) + ruby_parser (~> 3.7.0) + safe_yaml (>= 1.0) + sass (~> 3.0) + slim (>= 1.3.6, < 4.0) + terminal-table (~> 1.4) builder (3.2.2) cancancan (1.10.1) coffee-rails (4.0.1) @@ -63,8 +75,12 @@ GEM warden (~> 1.2.3) erubis (2.7.0) execjs (2.5.2) + fastercsv (1.5.5) globalid (0.3.6) activesupport (>= 4.1.0) + haml (4.0.7) + tilt + highline (1.7.8) i18n (0.7.0) jbuilder (2.2.13) activesupport (>= 3.0.0, < 5) @@ -91,12 +107,6 @@ GEM passenger (5.0.7) rack rake (>= 0.8.1) - postmark (1.7.0) - json - rake - postmark-rails (0.12.0) - actionmailer (>= 3.0.0) - postmark (~> 1.7.0) puma (2.11.2) rack (>= 1.1, < 2.0) rack (1.6.4) @@ -139,9 +149,20 @@ GEM responders (2.1.0) railties (>= 4.2.0, < 5) round_robin_tournament (0.0.1) + ruby2ruby (2.2.0) + ruby_parser (~> 3.1) + sexp_processor (~> 4.0) + ruby_parser (3.7.3) + sexp_processor (~> 4.1) + safe_yaml (1.0.4) + sass (3.4.21) sdoc (0.4.1) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) + sexp_processor (4.6.1) + slim (3.0.6) + temple (~> 0.7.3) + tilt (>= 1.3.3, < 2.1) spring (1.3.5) sprockets (3.5.0) concurrent-ruby (~> 1.0) @@ -151,11 +172,14 @@ GEM activesupport (>= 3.0) sprockets (>= 2.8, < 4.0) sqlite3 (1.3.10) + temple (0.7.6) + terminal-table (1.5.2) therubyracer (0.12.2) libv8 (~> 3.16.14.0) ref thor (0.19.1) thread_safe (0.3.5) + tilt (2.0.2) turbolinks (2.5.3) coffee-rails tzinfo (1.2.2) @@ -170,6 +194,7 @@ PLATFORMS ruby DEPENDENCIES + brakeman cancancan coffee-rails (~> 4.0.0) dalli @@ -180,7 +205,6 @@ DEPENDENCIES mysql2 newrelic_rpm passenger - postmark-rails puma rails (= 4.2.5) rails_12factor @@ -194,4 +218,4 @@ DEPENDENCIES uglifier (>= 1.3.0) BUNDLED WITH - 1.10.6 + 1.11.2 diff --git a/README.rdoc b/README.rdoc index 3756cdb..7d37e77 100644 --- a/README.rdoc +++ b/README.rdoc @@ -16,7 +16,7 @@ MIT License Development details: -* Ruby 2.2.0 +* Ruby 2.3.0 * Rails 4.2.5 diff --git a/config/routes.rb b/config/routes.rb index c3c436c..2b49bab 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -15,8 +15,6 @@ Wrestling::Application.routes.draw do post "/weights/:id" => "weights#show" - - # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". diff --git a/deploy/deploy-prod.sh b/deploy/deploy-prod.sh index 45b3ecb..f375de2 100755 --- a/deploy/deploy-prod.sh +++ b/deploy/deploy-prod.sh @@ -2,7 +2,7 @@ gpg prod.env.gpg cd .. bash rails-prod.sh wrestlingdev cd deploy -docker-compose -f docker-compose-prod.yml up -d -echo Make sure your local mysql database has a db for wrestlingdev +docker-compose -f docker-compose-prod-full-stack.yml up -d +echo Make sure your local mysql database has a db for wrestlingdev called wrestlingtourney echo "mysqldump -u guy -ppassword -h host database_name > database.sql" echo "mysql -u guy -ppassword -h host database_name < database.sql" diff --git a/deploy/docker-compose-common.yml b/deploy/docker-compose-common.yml index 6e6b5d4..5bfe0fc 100644 --- a/deploy/docker-compose-common.yml +++ b/deploy/docker-compose-common.yml @@ -19,3 +19,7 @@ email: memcached: image: memcached mem_limit: 64000000 + +worker: + image: wrestlingdev + command: /bin/bash -c "cd /var/www && bundle exec rake jobs:work RAILS_ENV=production" diff --git a/deploy/docker-compose-prod-full-stack.yml b/deploy/docker-compose-prod-full-stack.yml index d754666..ed3e280 100644 --- a/deploy/docker-compose-prod-full-stack.yml +++ b/deploy/docker-compose-prod-full-stack.yml @@ -14,3 +14,12 @@ db: restart: always env_file: - ./prod.env +worker: + extends: + file: docker-compose-common.yml + service: worker + links: + - db + restart: always + env_file: + - ./prod.env diff --git a/deploy/docker-compose-prod-webapp.yml b/deploy/docker-compose-prod-webapp.yml deleted file mode 100644 index d416da1..0000000 --- a/deploy/docker-compose-prod-webapp.yml +++ /dev/null @@ -1,9 +0,0 @@ -app: - extends: - file: docker-compose-common.yml - service: app - links: - - db - restart: always - env_file: - - ./prod.env diff --git a/deploy/docker-compose-test.yml b/deploy/docker-compose-test.yml index d9f8466..9a8919c 100644 --- a/deploy/docker-compose-test.yml +++ b/deploy/docker-compose-test.yml @@ -21,3 +21,19 @@ db: environment: - MYSQL_ROOT_PASSWORD=password restart: always +worker: + extends: + file: docker-compose-common.yml + service: worker + environment: + - WRESTLINGDEV_DB_NAME=wrestlingtourney + - WRESTLINGDEV_DB_USR=root + - WRESTLINGDEV_DB_PWD=password + - WRESTLINGDEV_DB_HOST=db + - WRESTLINGDEV_DB_PORT=3306 + - WRESTLINGDEV_DEVISE_SECRET_KEY=2f29d49db6704377ba263f7cb9db085b386bcb301c0cd501126a674686ab1a109754071165b08cd72af03cec4642a4dd04361c994462254dd5d85e9594e8b9aa + - WRESTLINGDEV_SECRET_KEY_BASE=077cdbef5c2ccf22543fb17a67339f234306b7fa2e1e4463d851c444c10a5611829a2290b253da78339427f131571fac9a42c83d960b2d25ecc10a4a0a7ce1a2 + + links: + - db + restart: always diff --git a/deploy/server-deploy-prod.sh b/deploy/server-deploy-prod.sh deleted file mode 100755 index 4ec4ace..0000000 --- a/deploy/server-deploy-prod.sh +++ /dev/null @@ -1,22 +0,0 @@ -if [ -z "$2" ] - then - echo "usage) server-deploy-prod.sh user@server docker-compose-file-name.yml" - exit 1 -fi - -echo "Copying your ssh key to ${1}" -ssh-copy-id $1 -clear -ssh -t $1 bash -c "' -cd wrestlingApp -mv deploy/prod.env ../ -git pull origin master -mv ../prod.env deploy/ - -#Kill all containers -docker kill $(docker ps -q) - -bash rails-prod.sh wrestlingdev -cd deploy -docker-compose -f ${2} up -d -'" \ No newline at end of file diff --git a/rails-dev-Dockerfile b/rails-dev-Dockerfile index 1b2e21c..564a628 100644 --- a/rails-dev-Dockerfile +++ b/rails-dev-Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.2.3 +FROM ruby:2.3.0 RUN apt-get update diff --git a/rails-prod-Dockerfile b/rails-prod-Dockerfile index fbc8dee..385ef79 100644 --- a/rails-prod-Dockerfile +++ b/rails-prod-Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.2.3 +FROM ruby:2.3.0 RUN apt-get update diff --git a/rails-prod.sh b/rails-prod.sh index edf4b1a..5210542 100755 --- a/rails-prod.sh +++ b/rails-prod.sh @@ -13,4 +13,4 @@ docker ps | grep "Exit" | awk '{print $1}' | while read -r id ; do docker kill $id done -docker run -h $HOSTNAME -d --restart=always --env-file $WRESTLINGDEV_ENV_FILE -v /srv/docker/apache2/logs:/var/log/apache2 -v /etc/localtime:/etc/localtime -p 80:80 -p 443:443 $1 +docker run -h $HOSTNAME -d --restart=always --env-file $WRESTLINGDEV_ENV_FILE -v /var/log/apache2:/var/log/apache2 -v /etc/localtime:/etc/localtime -p 80:80 -p 443:443 $1