capistrano-backburner 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +2 -0
- data/LICENSE.txt +22 -0
- data/README.md +81 -0
- data/Rakefile +2 -0
- data/capistrano-backburner.gemspec +23 -0
- data/lib/capistrano/backburner.rb +1 -0
- data/lib/capistrano/tasks/backburner.rake +70 -0
- data/lib/capistrano-backburner.rb +0 -0
- metadata +80 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3789cd8a61c2341ba7ebd3b4e45ce97f6a0e4d88
|
4
|
+
data.tar.gz: 3b21c956608e09ce11ee06b9886210e26fc0ab5c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ae6ed155d4a2201bc3986b691941b0fa0b444a8a8f5c1065b7729233e69643f276e2fa3dab52f492b51a806c615f447c6d1c257b80422f7275ec4a79b267029d
|
7
|
+
data.tar.gz: 4ab9ec467dac3bb8db9f61d71787c318170c46ea3dad8d0d345caf00b5b9587322c05113f3d9b91d6f2ad424a3ab1b9bb675786d8fb74880002737d4fb190467
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2017 Kruger Heavy Industries
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
# Capistrano::Backburner
|
2
|
+
|
3
|
+
Backburner support for Capistrano 3.x
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'capistrano-backburner'
|
10
|
+
gem 'capistrano'
|
11
|
+
|
12
|
+
And then execute:
|
13
|
+
|
14
|
+
$ bundle
|
15
|
+
|
16
|
+
Or install it yourself as:
|
17
|
+
|
18
|
+
$ gem install capistrano-backburner
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
Require in `Capfile` to use the default task:
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
require 'capistrano/backburner'
|
26
|
+
```
|
27
|
+
|
28
|
+
You will get the following tasks
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
cap backburner:start # Start backburner service
|
32
|
+
cap backburner:stop # Stop backburner service
|
33
|
+
cap backburner:restart # Restart backburner service
|
34
|
+
```
|
35
|
+
|
36
|
+
Configurable options (copy into deploy.rb), shown here with examples:
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
# Backburner job queue or queues
|
40
|
+
# Set the --queue or --queues option to work from a particular queue.
|
41
|
+
# default value: nil
|
42
|
+
set :backburner_queues, ['default','mailer']
|
43
|
+
|
44
|
+
# Set the roles where the backburner process should be started
|
45
|
+
# default value: :app
|
46
|
+
set :backburner_roles, [:app]
|
47
|
+
|
48
|
+
# Set the location of the backburner process id file
|
49
|
+
# default value: 'tmp/pids/backburner.pid'
|
50
|
+
set :backburner_pid, 'tmp/pids/backburner.pid'
|
51
|
+
|
52
|
+
# Set the location of the backburner log file
|
53
|
+
# default value: 'log/backburner.log'
|
54
|
+
set :backburner_log, 'log/backburner.log'
|
55
|
+
|
56
|
+
```
|
57
|
+
|
58
|
+
It also adds the following hook
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
after 'deploy:published', 'restart' do
|
62
|
+
invoke 'backburner:restart'
|
63
|
+
end
|
64
|
+
```
|
65
|
+
|
66
|
+
## Contributing
|
67
|
+
|
68
|
+
1. Fork it
|
69
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
70
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
71
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
72
|
+
5. Create new Pull Request
|
73
|
+
|
74
|
+
## Credits
|
75
|
+
|
76
|
+
capistrano-backburner is maintained by [Kruger Heavy Industries](http://www.krugerheavyindustries.com)
|
77
|
+
|
78
|
+
## License
|
79
|
+
|
80
|
+
© 2017 Kruger Heavy Industries. It is free software and may be redistributed under the terms specified in the LICENSE file.
|
81
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "capistrano-backburner"
|
7
|
+
spec.version = "0.0.9"
|
8
|
+
spec.authors = ["Chris Kruger"]
|
9
|
+
spec.email = ["capistrano-backburner@krugerheavyindustries.com"]
|
10
|
+
spec.summary = %q{Support for backburner via Capistrano 3.x}
|
11
|
+
spec.description = %q{Adds support controlling backburner via Capistrano 3.x}
|
12
|
+
spec.homepage = "https://github.com/KrugerHeavyIndustries/capistrano-backburner"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_dependency 'capistrano', '~> 3.0'
|
21
|
+
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path('../tasks/backburner.rake', __FILE__)
|
@@ -0,0 +1,70 @@
|
|
1
|
+
namespace :backburner do
|
2
|
+
|
3
|
+
def backburner_args
|
4
|
+
args = []
|
5
|
+
#args << "-n #{fetch(:backburner_workers)}" unless fetch(:backburner_workers).nil?
|
6
|
+
args << "-q #{fetch(:backburner_queues).join(',')}" unless fetch(:backburner_queues).nil?
|
7
|
+
args << "-P #{backburner_pid}"
|
8
|
+
args << "-l #{backburner_log}"
|
9
|
+
args << "-d"
|
10
|
+
args.join(' ')
|
11
|
+
end
|
12
|
+
|
13
|
+
def backburner_roles
|
14
|
+
fetch(:backburner_roles)
|
15
|
+
end
|
16
|
+
|
17
|
+
def backburner_bin
|
18
|
+
'backburner'
|
19
|
+
end
|
20
|
+
|
21
|
+
def backburner_pid
|
22
|
+
fetch(:backburner_pid)
|
23
|
+
end
|
24
|
+
|
25
|
+
def backburner_log
|
26
|
+
fetch(:backburner_log)
|
27
|
+
end
|
28
|
+
|
29
|
+
desc 'Stop the backburner process'
|
30
|
+
task :stop do
|
31
|
+
on roles(backburner_roles) do
|
32
|
+
within current_path do
|
33
|
+
with rails_env: fetch(:rails_env) do
|
34
|
+
execute :bundle, :exec, backburner_bin, "-k -P #{backburner_pid}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
desc 'Start the backburner process'
|
41
|
+
task :start do
|
42
|
+
on roles(backburner_roles) do
|
43
|
+
within release_path do
|
44
|
+
with rails_env: fetch(:rails_env) do
|
45
|
+
execute :bundle, :exec, backburner_bin, backburner_args
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
desc 'Restart the backburner process'
|
52
|
+
task :restart do
|
53
|
+
on roles(backburner_roles) do
|
54
|
+
Rake::Task["backburner:stop"].invoke
|
55
|
+
Rake::Task["backburner:start"].invoke
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
after 'deploy:started', 'backburner:stop'
|
60
|
+
after 'deploy:published', 'backburner:start'
|
61
|
+
end
|
62
|
+
|
63
|
+
namespace :load do
|
64
|
+
task :defaults do
|
65
|
+
set :backburner_pid, 'tmp/pids/backburner.pid'
|
66
|
+
set :backburner_log, 'log/backburner.log'
|
67
|
+
set :backburner_queues, nil
|
68
|
+
set :backburner_roles, :app
|
69
|
+
end
|
70
|
+
end
|
File without changes
|
metadata
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-backburner
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.9
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chris Kruger
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-01-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: capistrano
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: Adds support controlling backburner via Capistrano 3.x
|
42
|
+
email:
|
43
|
+
- capistrano-backburner@krugerheavyindustries.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- Gemfile
|
49
|
+
- LICENSE.txt
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
|
+
- capistrano-backburner.gemspec
|
53
|
+
- lib/capistrano-backburner.rb
|
54
|
+
- lib/capistrano/backburner.rb
|
55
|
+
- lib/capistrano/tasks/backburner.rake
|
56
|
+
homepage: https://github.com/KrugerHeavyIndustries/capistrano-backburner
|
57
|
+
licenses:
|
58
|
+
- MIT
|
59
|
+
metadata: {}
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options: []
|
62
|
+
require_paths:
|
63
|
+
- lib
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
requirements: []
|
75
|
+
rubyforge_project:
|
76
|
+
rubygems_version: 2.6.12
|
77
|
+
signing_key:
|
78
|
+
specification_version: 4
|
79
|
+
summary: Support for backburner via Capistrano 3.x
|
80
|
+
test_files: []
|