Skip to content

Commit

Permalink
Merge pull request #2093 from chef/saghoshprogress/rails_6_omnibus_fix
Browse files Browse the repository at this point in the history
Upgrade rails to 6.1 and migrate nodejs to mini_racer
  • Loading branch information
tas50 authored Aug 11, 2021
2 parents 5702927 + f363439 commit d1cacd6
Show file tree
Hide file tree
Showing 139 changed files with 4,818 additions and 398 deletions.
2 changes: 1 addition & 1 deletion omnibus/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -424,4 +424,4 @@ DEPENDENCIES
test-kitchen

BUNDLED WITH
2.2.22
2.1.4
4 changes: 2 additions & 2 deletions omnibus/config/projects/supermarket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
build_iteration 1

override :postgresql, version: '9.3.25'
override :ruby, version: "2.6.8"
override :ruby, version: "2.7.4"
override :rubygems, version: "3.1.2" # rubygems ships its own bundler which may differ from bundler defined below and then we get double bundler which makes the omnibus environment unhappy. Make sure these versions match before bumping either.
override :bundler, version: "2.1.2" # this must match the BUNDLED WITH in all the repo's Gemfile.locks
override :'chef-gem', version: '14.14.29'
Expand Down Expand Up @@ -63,4 +63,4 @@
signing_passphrase ENV['OMNIBUS_RPM_SIGNING_PASSPHRASE']
compression_level 1
compression_type :xz
end
end
2 changes: 2 additions & 0 deletions omnibus/config/software/supermarket-cookbooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
cookbooks_path = "#{install_dir}/embedded/cookbooks"
env = with_standard_compiler_flags(with_embedded_path)

gem "install berkshelf"

command "berks vendor #{cookbooks_path}", env: env

block do
Expand Down
2 changes: 1 addition & 1 deletion omnibus/config/software/supermarket-ctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
build do
env = with_standard_compiler_flags(with_embedded_path)

bundle "install", env: env
bundle "install --binstubs", env: env

block do
erb source: "supermarket-ctl.erb",
Expand Down
9 changes: 6 additions & 3 deletions omnibus/config/software/supermarket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
env = with_standard_compiler_flags(with_embedded_path)
env['PATH'] = "#{env['PATH']}:#{install_dir}/embedded/nodejs/bin"

bundle "package --all --no-install"
if Bundler.feature_flag.cache_all?
bundle "package --no-install", env: env
else
bundle "package --all --no-install", env: env
end

bundle "install" \
" --jobs #{workers}" \
Expand All @@ -46,10 +50,9 @@
" --without development doc",
env: env

command "npm install yarn -g", env: env

# This fails because we're installing Ruby C extensions in the wrong place!
bundle "exec rake assets:precompile", env: env.merge('RAILS_ENV' => 'production')
bundle "exec rake assets:precompile", env: env

sync project_dir, "#{install_dir}/embedded/service/supermarket/",
exclude: %w( .cookbooks .direnv .envrc .env.* .gitignore .kitchen*
Expand Down
1 change: 1 addition & 0 deletions omnibus/cookbooks/omnibus-supermarket/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ source 'https://rubygems.org'

gem 'inspec'
gem 'inspec-bin'
gem 'mini_racer', '~> 0.3.1', platforms: :ruby

# gems for testing the build cookbooks
# once we get the ctl omnibus def using its own gemspec this whole file can die
Expand Down
3 changes: 3 additions & 0 deletions src/supermarket/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ Rails/SkipsModelValidations:
- touch
Style/SymbolArray:
EnforcedStyle: brackets
Rails/HttpStatus:
Enabled: true
EnforcedStyle: numeric
2 changes: 1 addition & 1 deletion src/supermarket/.ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.8
2.7.4
10 changes: 7 additions & 3 deletions src/supermarket/Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"

gem "fieri", path: "engines/fieri"
gem "rails", "~> 5.2.6"
gem "rails", "~> 6.1.4"

gem "omniauth"
gem "omniauth-chef-oauth2"
Expand All @@ -13,7 +13,7 @@ gem "sidekiq", "~> 4.2"
gem "sidekiq-cron"

gem "aws-sdk-s3"
gem "chef", require: false
gem "chef", "~> 16.13", require: false
gem "compass-rails"
gem "ddtrace", require: false
gem "dotenv"
Expand Down Expand Up @@ -52,6 +52,9 @@ gem "validate_url"
gem "virtus", "1.0.2", require: false # Pin to a version before the handling of nil in collection coercion was fixed.
gem "yajl-ruby"

gem "listen"
gem "therubyracer", platforms: :ruby

group :doc do
gem "yard", require: false
end
Expand All @@ -75,6 +78,7 @@ group :test do
gem "shoulda-matchers"
gem "vcr", require: false
gem "webmock", require: false
gem "puma"
end

group :development, :test do
Expand All @@ -92,4 +96,4 @@ group :development, :test do
# to 1.0.0 release when added
gem "and_feathers", ">= 1.0.0.pre", require: false
gem "and_feathers-gzipped_tarball", ">= 1.0.0.pre", require: false
end
end
Loading

0 comments on commit d1cacd6

Please sign in to comment.