From abce7ed17104fb104d8245b8d230d2c92dfb94a5 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Tue, 12 Mar 2024 09:45:54 -0400 Subject: [PATCH] Updated to rails 7.1 and ruby 3.1.4 --- Gemfile | 3 +++ Gemfile.lock | 8 ++++++++ config/environments/production.rb | 25 ++++++++----------------- deploy/deploy-test.sh | 7 ++++--- deploy/docker-compose-test.yml | 6 ++++++ 5 files changed, 29 insertions(+), 20 deletions(-) diff --git a/Gemfile b/Gemfile index a527a15..43f9b5c 100644 --- a/Gemfile +++ b/Gemfile @@ -7,6 +7,9 @@ gem 'rails', '7.1.3.2' # Added in rails 7.1 gem 'rails-html-sanitizer' +# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] +gem "sprockets-rails" + # Use sqlite3 as the database for Active Record #gem 'sqlite3', '~> 1.3', '< 1.4', :group => :development gem 'sqlite3', :group => :development diff --git a/Gemfile.lock b/Gemfile.lock index b08a1b5..93a630a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -275,6 +275,13 @@ GEM rack-session (>= 2.0.0, < 3) tilt (~> 2.0) spring (4.1.3) + sprockets (4.2.1) + concurrent-ruby (~> 1.0) + rack (>= 2.2.4, < 4) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + sprockets (>= 3.0.0) sqlite3 (1.7.2-aarch64-linux) sqlite3 (1.7.2-arm-linux) sqlite3 (1.7.2-arm64-darwin) @@ -338,6 +345,7 @@ DEPENDENCIES rubocop sdoc spring + sprockets-rails sqlite3 turbolinks tzinfo-data diff --git a/config/environments/production.rb b/config/environments/production.rb index b3a0ce4..fd342f5 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -19,23 +19,6 @@ Wrestling::Application.configure do # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. # config.action_dispatch.rack_cache = true - # Disable Rails's static asset server (Apache or nginx will already do this). - #This is deprecated - #config.serve_static_assets = false - - # Compress JavaScripts and CSS. - config.assets.js_compressor = :uglifier - # config.assets.css_compressor = :sass - - # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false - - # Generate digests for assets URLs. - config.assets.digest = true - - # Version of your assets, change this if you want to expire all your assets. - config.assets.version = '1.0' - # Specifies the header that your server uses for sending files. # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx @@ -91,7 +74,15 @@ Wrestling::Application.configure do #THESE ADDED BY ME TO GET RAILS 4 WORKING IN HEROKU config.cache_classes = true config.public_file_server.enabled = true + + ## Using default asset pipeline sprockets + #Live compile with sprockets instead of: rails assets:precompile config.assets.compile = true + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + # Generate digests for assets URLs. config.assets.digest = true #Added by me to force SSL in production on heroku diff --git a/deploy/deploy-test.sh b/deploy/deploy-test.sh index 7c76f14..d618a56 100755 --- a/deploy/deploy-test.sh +++ b/deploy/deploy-test.sh @@ -11,9 +11,10 @@ export PASSENGER_POOL_SIZE=$(expr $PASSENGER_POOL_FACTOR '*' 1) docker-compose -f ${project_dir}/deploy/docker-compose-test.yml kill docker-compose -f ${project_dir}/deploy/docker-compose-test.yml build docker-compose -f ${project_dir}/deploy/docker-compose-test.yml up -d +sleep 30s # echo Make sure your local mysql database has a wrestlingtourney db -docker exec -i deploy_app_1 rake db:create -docker exec -i deploy_app_1 rake db:migrate +docker-compose -f ${project_dir}/deploy/docker-compose-test.yml exec -T app rake db:create +docker-compose -f ${project_dir}/deploy/docker-compose-test.yml exec -T app rake db:migrate echo Resetting the db with seed data -docker exec -i deploy_app_1 bash -c "DISABLE_DATABASE_ENVIRONMENT_CHECK=1 rake db:reset" \ No newline at end of file +docker-compose -f ${project_dir}/deploy/docker-compose-test.yml exec -T app bash -c "DISABLE_DATABASE_ENVIRONMENT_CHECK=1 rake db:reset" diff --git a/deploy/docker-compose-test.yml b/deploy/docker-compose-test.yml index 7c7dc8e..66664f5 100644 --- a/deploy/docker-compose-test.yml +++ b/deploy/docker-compose-test.yml @@ -51,6 +51,12 @@ services: restart: always networks: database: + healthcheck: + test: mysqladmin ping -h 127.0.0.1 -u root --password=$$MYSQL_PASSWORD + start_period: 5s + interval: 5s + timeout: 5s + retries: 10 worker: image: wrestlingdev