lib/capistrano/tasks/foreman.cap in capistrano3-foreman-0.2.0 vs lib/capistrano/tasks/foreman.cap in capistrano3-foreman-0.2.3
- old
+ new
@@ -1,18 +1,16 @@
namespace :foreman do
desc 'Export the Procfile to Ubuntu upstart scripts'
task :export do
- puts "hu"
- #on roles(:app) do |host|
- # within current_path do
- # as :root do
- # execute :mkdir, "-p #{fetch(:log_directory)}"
- # execute :chown, "-R #{host.user}: #{fetch(:log_directory)}"
- # execute :bundle, "exec foreman export upstart /etc/init -a #{fetch(:application)} -u #{host.user} -l #{fetch(:log_directory)}"
- # end
- # end
- #end
+ on roles(:app) do |host|
+ log_path = shared_path.join('log')
+ within release_path do
+ as :root do
+ execute :bundle, "exec foreman export upstart /etc/init -a #{fetch(:application)} -u #{host.user} -l #{log_path}"
+ end
+ end
+ end
end
desc 'Start the application services'
task :start do
on roles(:app) do |host|
@@ -37,6 +35,8 @@
as :root do
execute :service, "#{fetch(:application)} start || service #{fetch(:application)} restart"
end
end
end
+
+ before 'deploy:publishing', 'foreman:export'
end
\ No newline at end of file