Capistrano - 从独角兽文件设置ENV变量

时间:2015-07-03 00:53:20

标签: ruby-on-rails capistrano env

我的服务器在/etc/default/unicorn中有环境变量...如何从capistrano执行此文件?我无法运行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

0 个答案:

没有答案