Last active
August 29, 2015 14:14
-
-
Save scrooloose/e076ecf7bdd27c0a4439 to your computer and use it in GitHub Desktop.
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
module OpsWorks | |
module RailsConfiguration | |
def self.determine_database_adapter(app_name, app_config, app_root_path, options = {}) | |
options = { | |
:consult_gemfile => true, | |
:force => false | |
}.update(options) | |
if options[:force] || app_config[:database][:adapter].blank? | |
# a bunch of confusing shit | |
else | |
app_config[:database][:adapter] | |
end | |
end | |
def self.bundle(app_name, app_config, app_root_path) | |
if File.exists?("#{app_root_path}/Gemfile") | |
Chef::Log.info("Gemfile detected. Running bundle install.") | |
Chef::Log.info("sudo su - #{app_config[:user]} -c 'cd #{app_root_path} && /usr/local/bin/bundle install --path #{app_config[:home]}/.bundler/#{app_name} --without=#{app_config[:ignore_bundler_groups].join(' ')}'") | |
Chef::Log.info(OpsWorks::ShellOut.shellout("sudo su - #{app_config[:user]} -c 'cd #{app_root_path} && /usr/local/bin/bundle install --path #{app_config[:home]}/.bundler/#{app_name} --without=#{app_config[:ignore_bundler_groups].join(' ')}' 2>&1")) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment