Skip to content

Commit

Permalink
Make sure rails environment is available for deploy:migrations
Browse files Browse the repository at this point in the history
Signed-off-by: Rails Machine <ops@railsmachine.com>
  • Loading branch information
Rails Machine Ops committed Sep 11, 2012
1 parent b75c37b commit dafd26b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/moonshine/capistrano_integration.rb
Expand Up @@ -37,7 +37,7 @@ def self.load_defaults_info(capistrano_config)
set :assets_prefix, "assets"
set :assets_role, [:app]

set :bundle_roles, [:app, :resque, :dj]
set :bundle_roles, [:app, :resque, :dj, :db]

# know the path to rails logs
set :rails_log do
Expand Down Expand Up @@ -185,6 +185,12 @@ def self.load_into(capistrano_config)
end
end

before 'deploy:migrations' do
if File.exist?('Gemfile')
capistrano_config.require 'bundler/capistrano'
end
end

after 'deploy' do
deploy.rollback.default if fetch(:noop)
end
Expand Down Expand Up @@ -531,7 +537,7 @@ def self.load_into(capistrano_config)

task :src193 do
remove_ruby_from_apt
pv = "1.9.3-p194"
pv = "1.9.3-p125"
p = "ruby-#{pv}"
run [
'cd /tmp',
Expand Down Expand Up @@ -612,7 +618,6 @@ def self.load_into(capistrano_config)
end

namespace :ssl do
desc "Create a private key and cerfiticate request for SSL"
task :create do
csr = (moonshine_yml[:ssl] && moonshine_yml[:ssl][:csr]) || {}

Expand All @@ -637,6 +642,7 @@ def self.load_into(capistrano_config)


puts <<-MESSAGE
Your csr & key have been generated and saved in config/ssl:
* config/ssl/#{filesystem_safe_domain}.csr
Expand Down

0 comments on commit dafd26b

Please sign in to comment.