3

My server has the environment variables in /etc/default/unicorn... how can I execute this file from capistrano? I am unable to run rake db:migrate.

namespace :setup do
    desc "Setup environments variables."
    task :set_env do
        on roles(:all) do
          execute ". /etc/default/unicorn"
        end
    end
end

namespace :deploy do
    after "finished", "setup:set_env"
    after :restart, :clear_cache do
        on roles(:web), in: :groups, limit: 3, wait: 10 do
          # Here we can do anything such as:
          # within release_path do
          #   execute :rake, 'cache:clear'
          # end
        end
    end
Bruno Quaresma
  • 9,457
  • 7
  • 32
  • 50

0 Answers0