-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
specify node and rvm versions via custom alias
- Loading branch information
1 parent
ff8ce5f
commit 5704b86
Showing
4 changed files
with
29 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,9 @@ | |
# used to run rake db:migrate, etc | ||
# Default value for :rails_env is fetch(:stage) | ||
set :rails_env, fetch(:deploy_name) | ||
# use the rvm wrapper | ||
# use the rvm and nvm wrappers | ||
set :rvm_custom_path, '~/.rvm-alma8' | ||
set :nvm_custom_path, '~/.nvm-alma8' | ||
set :rvm_ruby_version, fetch(:deploy_name) | ||
|
||
set :repo_url, "[email protected]:cul/ac-academiccommons.git" | ||
|
@@ -21,9 +22,6 @@ | |
# Default value for :format is :airbrussh | ||
# set :format, :airbrussh | ||
|
||
# Default value for :log_level is :debug | ||
set :log_level, :info | ||
|
||
# Default value for linked_dirs is [] | ||
set :linked_dirs, | ||
fetch(:linked_dirs, []).push('log','tmp/pids', 'storage', 'public/feature-logos', 'node_modules', 'public/packs') | ||
|
@@ -42,6 +40,29 @@ | |
'public/robots.txt', | ||
) | ||
|
||
# Default value for :log_level is :debug | ||
set :log_level, :info | ||
|
||
# NVM Setup, for selecting the correct node version | ||
# NOTE: This NVM configuration MUST be configured before the RVM setup steps because: | ||
# This works: | ||
# nvm exec 16 ~/.rvm-alma8/bin/rvm example_app_dev do node --version | ||
# But this does not work: | ||
# ~/.rvm-alma8/bin/rvm example_app_dev do nvm exec 16 node --version | ||
set :nvm_node_version, fetch(:deploy_name) # This NVM alias must exist on the server | ||
[:rake, :node, :npm, :yarn].each do |command_to_prefix| | ||
# SSHKit.config.command_map.prefix[command_to_prefix].push("nvm exec #{fetch(:nvm_node_version)}") | ||
SSHKit.config.command_map.prefix[command_to_prefix].push("#{fetch(:nvm_custom_path, '~/.nvm')}/nvm.sh exec #{fetch(:nvm_node_version)}") | ||
end | ||
|
||
# RVM Setup, for selecting the correct ruby version (instead of capistrano-rvm gem) | ||
set :rvm_ruby_version, fetch(:deploy_name) # This RVM alias must exist on the server | ||
[:rake, :gem, :bundle, :ruby].each do |command_to_prefix| | ||
SSHKit.config.command_map.prefix[command_to_prefix].push( | ||
"#{fetch(:rvm_custom_path, '~/.rvm')}/bin/rvm #{fetch(:rvm_ruby_version)} do" | ||
) | ||
end | ||
|
||
set :ssh_options, { forward_agent: true } | ||
|
||
# Namespace crontab based on app environment. | ||
|