Set Capistrano task for deployment only, not for deployment: cold
I am using craken to run cron processes on my aws machine instance. I have defined the following custom tasks in Capistrano:
namespace :craken do
desc "Install raketab"
task :install, :roles => :cron do
set :rails_env, "production" unless exists?(:rails_env)
set :env_args, (exists?(:env_args) ? env_args : "app_name=#{application} deploy_path=#{current_path}")
run "cd #{current_path} && rake #{env_args} RAILS_ENV=#{rails_env} craken:install"
end
task :uninstall, :roles => :cron do
set :rails_env, "production" unless exists?(:rails_env)
set :env_args, (exists?(:env_args) ? env_args : "app_name=#{application} deploy_path=#{current_path}")
run "cd #{current_path} && rake #{env_args} RAILS_ENV=#{rails_env} craken:uninstall"
end
end
before "deploy:symlink", "craken:uninstall"
after "deploy:symlink", "craken:install"
The problem is that, before "deploy: symlink", "craken: uninstall" the reasons for the deployment: cold crash on first launch as craken raketab is still not installed. How can I configure this to run only if it is deploying rather than deploying: cold? Is there an environment variable I can check?
Thanks!
+1
a source to share
2 answers
The deploy: cold task is no longer recommended.
http://www.capify.org/index.php/From_The_Beginning#About_deploy:cold
+2
a source to share