From 82adf35105789787865a097b579c6cd817cc0769 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 12 Jan 2026 20:22:07 +0000 Subject: [PATCH] Make rails_port install node modules before running db:migrate --- cookbooks/web/resources/rails_port.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cookbooks/web/resources/rails_port.rb b/cookbooks/web/resources/rails_port.rb index b359711ff..9c503abf7 100644 --- a/cookbooks/web/resources/rails_port.rb +++ b/cookbooks/web/resources/rails_port.rb @@ -434,27 +434,27 @@ action :create do subscribes :run, "git[#{rails_directory}]" end - bundle_exec "#{rails_directory}/db/migrate" do + bundle_exec "#{rails_directory}/package.json" do action :nothing directory rails_directory - command "rails db:migrate" + command "rails yarn:install" + environment "HOME" => rails_directory, + "RAILS_ENV" => "production", + "SECRET_KEY_BASE_DUMMY" => "1" user new_resource.user group new_resource.group subscribes :run, "git[#{rails_directory}]" - only_if { new_resource.run_migrations } + only_if { new_resource.build_assets } end - bundle_exec "#{rails_directory}/package.json" do + bundle_exec "#{rails_directory}/db/migrate" do action :nothing directory rails_directory - command "rails yarn:install" - environment "HOME" => rails_directory, - "RAILS_ENV" => "production", - "SECRET_KEY_BASE_DUMMY" => "1" + command "rails db:migrate" user new_resource.user group new_resource.group subscribes :run, "git[#{rails_directory}]" - only_if { new_resource.build_assets } + only_if { new_resource.run_migrations } end bundle_exec "#{rails_directory}/config/i18n-js.yml" do -- 2.39.5