Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
capistrano-sneakers
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
capistrano-sneakers
Commits
acee972a
Unverified
Commit
acee972a
authored
Jan 26, 2018
by
Andrew Babichev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hook monit tasks to deploy flow explicitly
parent
97c2a601
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
lib/capistrano/tasks/monit.rake
+14
-3
No files found.
lib/capistrano/tasks/monit.rake
View file @
acee972a
namespace
:load
do
namespace
:load
do
task
:defaults
do
task
:defaults
do
set
:sneakers_monit_default_hooks
,
true
set
:sneakers_monit_conf_dir
,
->
{
'/etc/monit/conf.d'
}
set
:sneakers_monit_conf_dir
,
->
{
'/etc/monit/conf.d'
}
set
:sneakers_monit_use_sudo
,
true
set
:sneakers_monit_use_sudo
,
true
set
:sneakers_monit_bin
,
'/usr/bin/monit'
set
:sneakers_monit_bin
,
'/usr/bin/monit'
...
@@ -7,8 +8,21 @@ namespace :load do
...
@@ -7,8 +8,21 @@ namespace :load do
end
end
end
end
namespace
:deploy
do
before
:starting
,
:check_sidekiq_monit_hooks
do
if
fetch
(
:sneakers_default_hooks
)
&&
fetch
(
:sneakers_monit_default_hooks
)
invoke
'sneakers:monit:add_default_hooks'
end
end
end
namespace
:sneakers
do
namespace
:sneakers
do
namespace
:monit
do
namespace
:monit
do
task
:add_default_hooks
do
before
'deploy:updating'
,
'sneakers:monit:unmonitor'
after
'deploy:published'
,
'sneakers:monit:monitor'
end
desc
'Config Sneakers monit-service'
desc
'Config Sneakers monit-service'
task
:config
do
task
:config
do
on
roles
(
fetch
(
:sneakers_role
))
do
|
role
|
on
roles
(
fetch
(
:sneakers_role
))
do
|
role
|
...
@@ -57,9 +71,6 @@ namespace :sneakers do
...
@@ -57,9 +71,6 @@ namespace :sneakers do
end
end
end
end
before
'deploy:updating'
,
'sneakers:monit:unmonitor'
after
'deploy:published'
,
'sneakers:monit:monitor'
def
sneakers_service_name
def
sneakers_service_name
fetch
(
:sneakers_service_name
,
"sneakers_
#{
fetch
(
:application
)
}
_
#{
fetch
(
:sneakers_env
)
}
"
)
fetch
(
:sneakers_service_name
,
"sneakers_
#{
fetch
(
:application
)
}
_
#{
fetch
(
:sneakers_env
)
}
"
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment