recap icon indicating copy to clipboard operation
recap copied to clipboard

How are environment variables supposed to function?

Open naemono opened this issue 10 years ago • 0 comments

I actually pushed environment variables to ~/.env, and saw recap generate the .recap-env-export properly.

but when running 'cap whatever bootstrap', then ' cap whatever deploy:setup', then 'cap whatever deploy' my environment variables are not seen by db:migrate.

I actually had to override the migrate, and precompile tasks in Capfile like so for it to function:

namespace :rails do namespace :assets do namespace :precompile do task :default do as_app ". #{application_home}/.recap-env-export && RAILS_ENV=#{rails_env} bundle exec rake RAILS_GROUPS=assets assets:precompile" end end end

namespace :db do task :migrate do if (deployed_file_exists?("db/schema.rb") || deployed_file_exists?("db/structure.sql")) && trigger_update?("db/") as_app_once ". #{application_home}/.recap-env-export && RAILS_ENV=#{rails_env} bundle exec rake db:migrate" end end end end

Any ideas about this?

naemono avatar Jun 06 '14 18:06 naemono