Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/daemon_kit/deployment/capistrano.rb
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def try_runner(*args)
the :use_sudo variable to false.
DESC
task :start do
try_runner "/usr/bin/env DAEMON_ENV=#{fetch(:daemon_env)} #{current_path}/bin/#{application} start"
try_runner "cd #{current_path} && /usr/bin/env DAEMON_ENV=#{fetch(:daemon_env)} bin/#{application} start"
end

desc <<-DESC
Expand All @@ -468,7 +468,7 @@ def try_runner(*args)
the :use_sudo variable to false.
DESC
task :stop do
try_runner "/usr/bin/env DAEMON_ENV=#{fetch(:daemon_env)} #{current_path}/bin/#{application} stop"
try_runner "cd #{current_path} && /usr/bin/env DAEMON_ENV=#{fetch(:daemon_env)} bin/#{application} stop"
end

namespace :pending do
Expand Down Expand Up @@ -502,7 +502,7 @@ def try_runner(*args)

task :bundle_new_release, :roles => :app do
bundler.create_symlink
run "cd #{release_path} && bundle install .bundle --without test"
run "cd #{release_path} && bundle install --without test"
end

task :lock, :roles => :app do
Expand Down
27 changes: 15 additions & 12 deletions templates/god/god.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
#
# More information can be found at http://god.rubyforge.org/
#
require 'tlsmail'
Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)

DAEMON_ROOT = "<%= DaemonKit.root %>"

God.watch do |w|
w.name = '<%= DaemonKit.configuration.daemon_name %>'
w.interval = 30.seconds
w.start = "/usr/bin/env DAEMON_ENV=<%= DaemonKit.env %> #{DAEMON_ROOT}/bin/<%= DaemonKit.configuration.daemon_name %> start"
w.stop = "/usr/bin/env DAEMON_ENV=<%= DaemonKit.env %> #{DAEMON_ROOT}/bin/<%= DaemonKit.configuration.daemon_name %> stop"
w.start = "cd #{DAEMON_ROOT} && /usr/bin/env DAEMON_ENV=<%= DaemonKit.env %> bin/<%= DaemonKit.configuration.daemon_name %> start"
w.stop = "cd #{DAEMON_ROOT} && /usr/bin/env DAEMON_ENV=<%= DaemonKit.env %> bin/<%= DaemonKit.configuration.daemon_name %> stop"
w.start_grace = 10.seconds
w.stop_grace = 10.seconds
w.pid_file = "<%= DaemonKit.configuration.pid_file %>"
Expand Down Expand Up @@ -54,16 +56,17 @@ God.watch do |w|
end
end

God::Contacts::Email.server_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "localhost",
:authentication => :plain,
:user_name => "you@gmail.com",
:password => "secret"
}
God::Contacts::Email.defaults do |d|
d.delivery_method = :smtp
d.server_host = 'smtp.gmail.com'
d.server_port = 587
d.server_auth = :login
d.server_domain = 'example.com'
d.server_user = 'user@example.com'
d.server_password = 'password'
end

God.contact(:email) do |c|
c.name = 'sysadmin'
c.email = 'you@gmail.com'
end
c.to_email = 'someones@email.com'
end