Cross Reference:
xref
: /
ontohub
/
config
/
deploy
/
god.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
god.rb revision 234a52ce997ea67bbf347044e7c4e9c0f5317b34
3199
N/A
#
https://makandracards.com/makandra/1431-resque-+-god-+-capistrano
3199
N/A
namespace
:
god
do
3199
N/A
def
god_is_running
3199
N/A
!
capture
(
"#{god_command} status >/
dev
/
null
2>/
dev
/
null
|| echo 'not running'"
)
.
start_with
?
(
'not running'
)
3199
N/A
end
3199
N/A
3199
N/A
def
god_command
3199
N/A
"cd #{current_path}; bundle exec god"
3199
N/A
end
3199
N/A
3199
N/A
desc
"Start god"
3199
N/A
task
:
start
do
3199
N/A
run
"#{god_command} -c
config
/
god
/
app.rb
"
, :
env
=>
environment
=
{ :
RAILS_ENV
=>
rails_env
}
3199
N/A
end
3199
N/A
3199
N/A
desc
"Stop god"
3199
N/A
task
:
stop
do
3199
N/A
if
god_is_running
3199
N/A
run
"#{god_command} terminate"
3199
N/A
end
3199
N/A
end
3199
N/A
6033
N/A
desc
"Test if god is running"
3199
N/A
task
:
status
do
4070
N/A
puts
god_is_running
?
"God is running"
:
"God is NOT running"
3199
N/A
end
3199
N/A
end
3199
N/A
6033
N/A
before
"deploy:update"
,
"god:stop"
6033
N/A
after
"deploy:update"
,
"god:start"