Skip to content

Commit

Permalink
7.0 update with fix for assets
Browse files Browse the repository at this point in the history
  • Loading branch information
terrywbrady committed Nov 13, 2024
1 parent b04b7c8 commit 32c7a2f
Show file tree
Hide file tree
Showing 16 changed files with 307 additions and 156 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ COPY . .
RUN bundle install

# Build a discardable master.key and credentials.yml.enc file for docker deployment
RUN EDITOR=nano rails credentials:edit
RUN EDITOR=nano bundle exec rails credentials:edit

ENV SSM_SKIP_RESOLUTION=Y
RUN bundle exec rails assets:precompile && \
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ gem 'activeresource'
gem 'json'
gem 'multi_json'
gem 'mysql2'
gem 'rails', '7.0'
gem 'rails', '7.0.1'

gem 'aws-sdk-ec2'
gem 'aws-sdk-ssm'
Expand All @@ -29,6 +29,7 @@ gem 'puma'
gem 'rack-cache'
gem 'rest-client'
gem 'sprockets'
gem 'sprockets-rails'
gem 'thin'
gem 'uc3-ssm', git: 'https://github.com/CDLUC3/uc3-ssm.git', tag: '1.0.3'
gem 'uglifier'
Expand Down
119 changes: 65 additions & 54 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,69 +8,75 @@ GIT
GEM
remote: http://rubygems.org/
specs:
actioncable (7.0.0)
actionpack (= 7.0.0)
activesupport (= 7.0.0)
actioncable (7.0.1)
actionpack (= 7.0.1)
activesupport (= 7.0.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.0)
actionpack (= 7.0.0)
activejob (= 7.0.0)
activerecord (= 7.0.0)
activestorage (= 7.0.0)
activesupport (= 7.0.0)
actionmailbox (7.0.1)
actionpack (= 7.0.1)
activejob (= 7.0.1)
activerecord (= 7.0.1)
activestorage (= 7.0.1)
activesupport (= 7.0.1)
mail (>= 2.7.1)
actionmailer (7.0.0)
actionpack (= 7.0.0)
actionview (= 7.0.0)
activejob (= 7.0.0)
activesupport (= 7.0.0)
net-imap
net-pop
net-smtp
actionmailer (7.0.1)
actionpack (= 7.0.1)
actionview (= 7.0.1)
activejob (= 7.0.1)
activesupport (= 7.0.1)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.0)
actionview (= 7.0.0)
activesupport (= 7.0.0)
actionpack (7.0.1)
actionview (= 7.0.1)
activesupport (= 7.0.1)
rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.0)
actionpack (= 7.0.0)
activerecord (= 7.0.0)
activestorage (= 7.0.0)
activesupport (= 7.0.0)
actiontext (7.0.1)
actionpack (= 7.0.1)
activerecord (= 7.0.1)
activestorage (= 7.0.1)
activesupport (= 7.0.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.0)
activesupport (= 7.0.0)
actionview (7.0.1)
activesupport (= 7.0.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.0)
activesupport (= 7.0.0)
activejob (7.0.1)
activesupport (= 7.0.1)
globalid (>= 0.3.6)
activemodel (7.0.0)
activesupport (= 7.0.0)
activemodel (7.0.1)
activesupport (= 7.0.1)
activemodel-serializers-xml (1.0.3)
activemodel (>= 5.0.0.a)
activesupport (>= 5.0.0.a)
builder (~> 3.1)
activerecord (7.0.0)
activemodel (= 7.0.0)
activesupport (= 7.0.0)
activerecord (7.0.1)
activemodel (= 7.0.1)
activesupport (= 7.0.1)
activeresource (6.1.4)
activemodel (>= 6.0)
activemodel-serializers-xml (~> 1.0)
activesupport (>= 6.0)
activestorage (7.0.0)
actionpack (= 7.0.0)
activejob (= 7.0.0)
activerecord (= 7.0.0)
activesupport (= 7.0.0)
activestorage (7.0.1)
actionpack (= 7.0.1)
activejob (= 7.0.1)
activerecord (= 7.0.1)
activesupport (= 7.0.1)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.0)
activesupport (7.0.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -268,30 +274,30 @@ GEM
rack
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.0)
actioncable (= 7.0.0)
actionmailbox (= 7.0.0)
actionmailer (= 7.0.0)
actionpack (= 7.0.0)
actiontext (= 7.0.0)
actionview (= 7.0.0)
activejob (= 7.0.0)
activemodel (= 7.0.0)
activerecord (= 7.0.0)
activestorage (= 7.0.0)
activesupport (= 7.0.0)
rails (7.0.1)
actioncable (= 7.0.1)
actionmailbox (= 7.0.1)
actionmailer (= 7.0.1)
actionpack (= 7.0.1)
actiontext (= 7.0.1)
actionview (= 7.0.1)
activejob (= 7.0.1)
activemodel (= 7.0.1)
activerecord (= 7.0.1)
activestorage (= 7.0.1)
activesupport (= 7.0.1)
bundler (>= 1.15.0)
railties (= 7.0.0)
railties (= 7.0.1)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.0)
actionpack (= 7.0.0)
activesupport (= 7.0.0)
railties (7.0.1)
actionpack (= 7.0.1)
activesupport (= 7.0.1)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand Down Expand Up @@ -366,6 +372,10 @@ GEM
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
sprockets-rails (3.5.2)
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
sshkit (1.23.2)
base64
net-scp (>= 1.1.2)
Expand Down Expand Up @@ -449,7 +459,7 @@ DEPENDENCIES
pry-remote
puma
rack-cache
rails (= 7.0)
rails (= 7.0.1)
rest-client
rspec-rails
rubocop
Expand All @@ -458,6 +468,7 @@ DEPENDENCIES
simplecov
simplecov-console
sprockets
sprockets-rails
thin
uc3-ssm!
uglifier
Expand Down
21 changes: 9 additions & 12 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require "fileutils"

# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
APP_ROOT = File.expand_path("..", __dir__)

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
Expand All @@ -13,24 +13,21 @@ FileUtils.chdir APP_ROOT do
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this file.

puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')

# Install JavaScript dependencies
system! 'bin/yarn'
puts "== Installing dependencies =="
system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install")

# puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml')
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
# unless File.exist?("config/database.yml")
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
# end

puts "\n== Preparing database =="
system! 'bin/rails db:prepare'
system! "bin/rails db:prepare"

puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'
system! "bin/rails log:clear tmp:clear"

puts "\n== Restarting application server =="
system! 'bin/rails restart'
system! "bin/rails restart"
end
5 changes: 3 additions & 2 deletions config/application.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
require_relative 'boot'
require_relative "boot"

require 'rails/all'
require 'uc3-ssm'
require 'sprockets/railtie'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Expand All @@ -10,7 +11,7 @@
module MrtDashboard
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.1
config.load_defaults 7.0

# Configuration for the application, engines, and railties goes here.
#
Expand Down
2 changes: 1 addition & 1 deletion config/credentials.yml.enc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
+reX7Lef3AtfL7IqdwEqulMr2lttk7tbUocEMKyFFmkMY/riGYNN1JqHGtdJv0z4RtiLqmXQxWN48u+DrF9eeDpl0f0hGXU0ROXKUyAp4/H8wGaePyKLD/vvv62BrevuXm3SOSTEoxos11XsI6Ebm/DKz8iJ6DGJpfBde7Q9ynYcogLPIHTPMZPSVG1qGxQ8erC0Nj+ufHT50a2v+tluXmiWGjK8RLaZePWVXRsT+ai5z01vBlkjqBu9hQM+iWU7XuMxjVNRG53BOrfR8lAr5Kdvf5LoRiXg/A3hcdp/zuzfQqr3tiaAPvqQDhmZ7S66W71w+IoyJxcdb75hm/P6OPx2avhzmdU5iyyF2W0Vxr7GIx7hduApSZXrMhOTQxVRZ3mbUzGt4P+2zBGnBwCQwzarP1g8THX+F+8z--CCwZz0WACsU7lXAd--QGShylJsWbeyxU9lfcyAIw==
6fPXWfisFvsjpcqotqfQfYX0RMoivRlLqU3MokLLb/CtOigDmiqU/eVo6KyK8XK781gD9vb0IEDomT1Cp2VnSJjdehSD0hj1Z6pfBgl/nKwGZ/880MgiyxStSoDhxLxkysHuhiNoHniT+LFALodieSiMka/EMaGUcZ4rlX0V0L9+hfjnF15Z7Y+mBwdOpIyJR5lwj4tXRwDcAbl5CFmSFx4/yRDOsOa1yv/iZIv5r5OdtD0ty4T5SPO7owQB2faslhQOoVrgNkyc973Hu+1EqSdvqWCae2Y/g37gRP00gHiwaqvYr4Ls1Y+hGiRnOemdr2zDBexTIUXOphYoTFFcRCnQ8RthVVDHtkrqMElf1ydCueknr0GypIX0Af3+kHJqMdcv4DrV9TBjU41ITEI5sf+vKTKIKxuR84RO--qi8+A5aW0B/LN65T--VACWk2hQAlwNgJtrgJO2JA==
18 changes: 6 additions & 12 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'active_support/core_ext/integer/time'
require "active_support/core_ext/integer/time"

Rails.application.configure do
config.hosts.clear
# Settings specified here will take precedence over those in config/application.rb.

# In the development environment your application's code is reloaded any time
Expand All @@ -15,15 +14,18 @@
# Show full error reports.
config.consider_all_requests_local = true

# Enable server timing
config.server_timing = true

# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
if Rails.root.join('tmp', 'caching-dev.txt').exist?
if Rails.root.join("tmp/caching-dev.txt").exist?
config.action_controller.perform_caching = true
config.action_controller.enable_fragment_cache_logging = true

config.cache_store = :memory_store
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{2.days.to_i}"
"Cache-Control" => "public, max-age=#{2.days.to_i}"
}
else
config.action_controller.perform_caching = false
Expand Down Expand Up @@ -68,14 +70,6 @@
# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true

# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker

# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true

# Prepend all log lines with the following tags.
config.log_tags = [:request_id]

end
17 changes: 1 addition & 16 deletions config/environments/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,13 @@
config.i18n.fallbacks = true
config.serve_static_files = true

# To turn off pipeline, set to false
config.assets.enabled = true

# 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

# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true

# Eager load code on boot. This eager loads most of Rails and
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true

config.active_support.deprecation = :log
config.cache_store = :memory_store, { size: 64.megabytes }

# Prepend all log lines with the following tags.
config.log_tags = [:request_id]
Expand Down
3 changes: 0 additions & 3 deletions config/environments/local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
# config.action_view.debug_rjs = true
config.whiny_nils = true

config.assets.enabled = false
config.assets.debug = false

# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
config.active_record.auto_explain_threshold_in_seconds = 0.5
Expand Down
Loading

0 comments on commit 32c7a2f

Please sign in to comment.