diff --git a/config/deploy.rb b/config/deploy.rb index 60438ff2162..eb6c799f929 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -46,6 +46,7 @@ def main_deploy_server "cd #{release_path} && eval \"$(fnm env)\"" end set :fnm_install_node_command, -> { "#{fetch(:fnm_setup_command)} && fnm use --install-if-missing" } +set :fnm_map_bins, %w[bundle node npm rake yarn] set :puma_conf, "#{release_path}/config/puma/#{fetch(:rails_env)}.rb" @@ -61,6 +62,7 @@ def main_deploy_server after :updating, "install_ruby" after "bundler:install", "install_node" + after "bundler:install", "map_node_bins" after "deploy:migrate", "add_new_settings" @@ -120,6 +122,20 @@ def main_deploy_server end end +task :map_node_bins do + on roles(:app) do + within release_path do + with rails_env: fetch(:rails_env) do + prefix = "#{fetch(:fnm_setup_command)} && fnm exec" + + fetch(:fnm_map_bins).each do |command| + SSHKit.config.command_map.prefix[command.to_sym].unshift(prefix) + end + end + end + end +end + task :refresh_sitemap do on roles(:app) do within release_path do