Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

How are environment variables supposed to function? #113

@naemono

Description

@naemono

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions