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
17ed2eb5
Commit
17ed2eb5
authored
Mar 11, 2015
by
Karl Kloppenborg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding in sneakers daemon control
parent
4522ef0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
lib/capistrano/sneakers.rb
+2
-1
lib/capistrano/tasks/sneakers.rb
+10
-1
No files found.
lib/capistrano/sneakers.rb
View file @
17ed2eb5
...
...
@@ -8,4 +8,4 @@ if cap_version >= Gem::Version.new('3.0.0')
load
File
.
expand_path
(
'../tasks/sneakers.rb'
,
__FILE__
)
else
raise
Gem
::
LoadError
,
"Capistrano-Sneakers requires capistrano version 3.0.0 or greater, version detected:
#{
cap_version
}
"
end
end
\ No newline at end of file
lib/capistrano/tasks/sneakers.rb
View file @
17ed2eb5
...
...
@@ -11,6 +11,7 @@ namespace :load do
set
:sneakers_processes
,
->
{
1
}
set
:sneakers_workers
,
->
{
false
}
# if this is false it will cause Capistrano to exit
set
:sneakers_run_config
,
->
{
false
}
# if this is true sneakers will run with preconfigured /config/initializers/sneakers.rb
set
:sneakers_boot_file
,
->
{
false
}
# Needed for booting daemons dynamically
# Rbenv and RVM integration
set
:rbenv_map_bins
,
fetch
(
:rbenv_map_bins
).
to_a
.
concat
(
%w(sneakers)
)
set
:rvm_map_bins
,
fetch
(
:rvm_map_bins
).
to_a
.
concat
(
%w(sneakers)
)
...
...
@@ -93,8 +94,16 @@ namespace :sneakers do
raise
"[ set :workers, ['worker1', 'workerN'] ] not configured properly, please configure the workers you wish to use"
if
fetch
(
:sneakers_workers
).
nil?
or
fetch
(
:sneakers_workers
)
==
false
or
!
fetch
(
:sneakers_workers
).
kind_of?
Array
workers
=
fetch
(
:sneakers_workers
).
compact
.
join
(
','
)
run
"cmd"
,
:env
=>
{
'WORKERS'
,
workers
}
#export this to environmental variable
#run "cmd", env: { 'WORKERS' => workers } #export this to environmental variable
info
"Starting the sneakers processes"
#workers.each do |worker|
raise
"Boot file not set, please configure [set :sneakers_boot_file]"
if
fetch
(
:sneakers_boot_file
)
==
false
with
rails_env: :production
,
workers:
workers
do
#execute :bundle, :exec, :sneakers, :work, workers, "--require=#{fetch(:sneakers_boot_file)}"
rake
'sneakers:run'
end
#execute :bundle, :exec, :sneakers, args.compact.join(' ')
else
# Using custom sneakers setup
...
...
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