capistrano-opscomplete 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/Gemfile.lock +60 -0
- data/README.md +33 -1
- data/capistrano-opscomplete.gemspec +7 -2
- data/lib/capistrano/opscomplete.rb +2 -1
- data/lib/capistrano/opscomplete/{tasks.rake → ruby.rake} +0 -0
- data/lib/capistrano/opscomplete/supervisor.rake +59 -0
- data/lib/capistrano/opscomplete/version.rb +1 -1
- metadata +11 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c5c6ec21950e64171120fc314ea2b909ceb7262fd1175732a93f5897b9a6933
|
4
|
+
data.tar.gz: daa695ea2c44e828cd82ee95c37cecc8ab6257421d1c8e7b05b5876cf5912a46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93c67f0e7960afb7b4c691cdd170b43215cc119b236beebe9b4bfb492dca3ca9d55d7e819d56bd034415c833669b0196291a6ff904c9df16c2dcb251d8e04243
|
7
|
+
data.tar.gz: 558e16c5063b40ff09ca57c0c4312454622cb3ca91a1b4817a1465ef8a424a65513162378792c97a5bf433b9ac130c411e7ac0ce8c367b75e34d5e859387408e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
+
## [0.6.0] - 2020-01-13
|
4
|
+
### Added
|
5
|
+
|
6
|
+
- Support for Procfiles/supervisord. See [this makandra card](https://makandracards.com/opscomplete/67829-procfile-support) for more information.
|
7
|
+
|
3
8
|
## [0.5.0] - 2019-12-09
|
4
9
|
### Changed
|
5
10
|
- Install the bundler version that was used to create the `Gemfile.lock` (`BUNDLED WITH`) if it is present. Can be overwritten by `set :bundler_version`.
|
@@ -13,7 +18,6 @@
|
|
13
18
|
- Allow using --force when installing a gem e.g. overwrite binaries
|
14
19
|
- Quote some shell arguments
|
15
20
|
|
16
|
-
|
17
21
|
## [0.3.0] - 2019-04-05
|
18
22
|
### Added
|
19
23
|
- You can now specify the rubygems and bundler version to be installed. (#4)
|
@@ -42,6 +46,7 @@
|
|
42
46
|
### Added
|
43
47
|
- Initial release.
|
44
48
|
|
49
|
+
[0.6.0]: https://github.com/makandra/capistrano-opscomplete/compare/v0.5.0...v0.6.0
|
45
50
|
[0.5.0]: https://github.com/makandra/capistrano-opscomplete/compare/v0.4.0...v0.5.0
|
46
51
|
[0.4.0]: https://github.com/makandra/capistrano-opscomplete/compare/v0.3.0...v0.4.0
|
47
52
|
[0.3.0]: https://github.com/makandra/capistrano-opscomplete/compare/v0.2.0...v0.3.0
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
capistrano-opscomplete (0.6.0)
|
5
|
+
capistrano (>= 3.0, < 4.0.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
airbrussh (1.4.0)
|
11
|
+
sshkit (>= 1.6.1, != 1.7.0)
|
12
|
+
ast (2.4.0)
|
13
|
+
capistrano (3.11.2)
|
14
|
+
airbrussh (>= 1.0.0)
|
15
|
+
i18n
|
16
|
+
rake (>= 10.0.0)
|
17
|
+
sshkit (>= 1.9.0)
|
18
|
+
concurrent-ruby (1.1.5)
|
19
|
+
i18n (1.8.2)
|
20
|
+
concurrent-ruby (~> 1.0)
|
21
|
+
jaro_winkler (1.5.4)
|
22
|
+
makandra-rubocop (4.2.0)
|
23
|
+
rubocop (~> 0.76.0)
|
24
|
+
rubocop-rails (~> 2.3.2)
|
25
|
+
net-scp (2.0.0)
|
26
|
+
net-ssh (>= 2.6.5, < 6.0.0)
|
27
|
+
net-ssh (5.2.0)
|
28
|
+
parallel (1.19.1)
|
29
|
+
parser (2.7.0.2)
|
30
|
+
ast (~> 2.4.0)
|
31
|
+
rack (2.1.1)
|
32
|
+
rainbow (3.0.0)
|
33
|
+
rake (10.5.0)
|
34
|
+
rubocop (0.76.0)
|
35
|
+
jaro_winkler (~> 1.5.1)
|
36
|
+
parallel (~> 1.10)
|
37
|
+
parser (>= 2.6)
|
38
|
+
rainbow (>= 2.2.2, < 4.0)
|
39
|
+
ruby-progressbar (~> 1.7)
|
40
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
41
|
+
rubocop-rails (2.3.2)
|
42
|
+
rack (>= 1.1)
|
43
|
+
rubocop (>= 0.72.0)
|
44
|
+
ruby-progressbar (1.10.1)
|
45
|
+
sshkit (1.20.0)
|
46
|
+
net-scp (>= 1.1.2)
|
47
|
+
net-ssh (>= 2.8.0)
|
48
|
+
unicode-display_width (1.6.0)
|
49
|
+
|
50
|
+
PLATFORMS
|
51
|
+
ruby
|
52
|
+
|
53
|
+
DEPENDENCIES
|
54
|
+
bundler (~> 2)
|
55
|
+
capistrano-opscomplete!
|
56
|
+
makandra-rubocop (~> 4)
|
57
|
+
rake (~> 10.0)
|
58
|
+
|
59
|
+
BUNDLED WITH
|
60
|
+
2.1.4
|
data/README.md
CHANGED
@@ -28,13 +28,45 @@ Verify the gem was installed and tasks are available:
|
|
28
28
|
|
29
29
|
$ bundle exec cap -T opscomplete
|
30
30
|
|
31
|
-
Now, add some [hooks](#using-capistrano-hooks) in your capistrano configuration.
|
31
|
+
Now, add some [hooks](#using-capistrano-hooks) in your capistrano configuration (e.g. `deploy.rb`).
|
32
|
+
An example configuration could look like this:
|
32
33
|
|
33
34
|
```ruby
|
34
35
|
# After unpacking your release, before bundling, compiling assets, ...
|
35
36
|
after 'deploy:updating', 'opscomplete:ruby:ensure'
|
36
37
|
```
|
37
38
|
|
39
|
+
and in case you enabled [`Procfile support`](https://makandracards.com/opscomplete/67829-procfile-support) you can use the following tasks:
|
40
|
+
|
41
|
+
opscomplete:supervisor:gen_config
|
42
|
+
opscomplete:supervisor:restart_procs
|
43
|
+
opscomplete:supervisor:stop_procs
|
44
|
+
opscomplete:supervisor:signal_procs
|
45
|
+
|
46
|
+
e.g. like this:
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
# Update and Restart supervisor config
|
50
|
+
after 'deploy:updating', 'opscomplete:supervisor:gen_config'
|
51
|
+
after 'deploy:published', 'opscomplete:supervisor:restart_procs'
|
52
|
+
```
|
53
|
+
|
54
|
+
Using the default configuration, these tasks will run on all Servers where role is `:app` using the Procfile called `Procfile`.
|
55
|
+
To change the role where these tasks will get executed, set `:procfile_role` in e.g. your `config/deploy.rb` like:
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
# Use supervisor tasks only for sidekiq role
|
59
|
+
set :procfile_role, :sidekiq
|
60
|
+
```
|
61
|
+
|
62
|
+
If you want to run different Procfiles on differen servers, you can set the `:procfile` property in your `config/deploy/${env}.rb`:
|
63
|
+
|
64
|
+
```
|
65
|
+
# In this example, `Procfile` will get used for supervisor on srv2.example.com and `Procfile.sidekiq` for supervisor on srv1.example.com.
|
66
|
+
server "srv1.example.com", user: "deploy-example_s", roles: %w{app web}, procfile: "Procfile.sidekiq"
|
67
|
+
server "srv2.example.com", user: "deploy-example_s", roles: %w{app web}
|
68
|
+
```
|
69
|
+
|
38
70
|
## Usage
|
39
71
|
|
40
72
|
If you encounter any errors, please make sure you have the newest version of the capistrano-opscomplete gem installed. Don't hesitate to contact the OpsComplete for Ruby team for further support.
|
@@ -14,7 +14,12 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
16
16
|
if spec.respond_to?(:metadata)
|
17
|
-
spec.metadata
|
17
|
+
spec.metadata = {
|
18
|
+
'allowed_push_host' => 'https://rubygems.org',
|
19
|
+
'bug_tracker_uri' => 'https://github.com/makandra/capistrano-opscomplete/issues',
|
20
|
+
'changelog_uri' => 'https://github.com/makandra/capistrano-opscomplete/blob/master/CHANGELOG.md',
|
21
|
+
'source_code_uri' => 'https://github.com/makandra/capistrano-opscomplete',
|
22
|
+
}
|
18
23
|
else
|
19
24
|
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
20
25
|
'public gem pushes.'
|
@@ -32,7 +37,7 @@ Gem::Specification.new do |spec|
|
|
32
37
|
spec.required_rubygems_version = '>=2.0.1'
|
33
38
|
|
34
39
|
spec.add_development_dependency 'makandra-rubocop', '~> 4'
|
35
|
-
spec.add_development_dependency 'bundler', '~>
|
40
|
+
spec.add_development_dependency 'bundler', '~> 2'
|
36
41
|
spec.add_development_dependency 'rake', '~> 10.0'
|
37
42
|
|
38
43
|
spec.add_dependency 'capistrano', '>=3.0', '<4.0.0'
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'capistrano/opscomplete/version'
|
2
2
|
|
3
|
-
load File.expand_path('opscomplete/
|
3
|
+
load File.expand_path('opscomplete/ruby.rake', __dir__)
|
4
|
+
load File.expand_path('opscomplete/supervisor.rake', __dir__)
|
4
5
|
load File.expand_path('opscomplete/deploy.rake', __dir__)
|
File without changes
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# vim: filetype=ruby
|
2
|
+
namespace :opscomplete do
|
3
|
+
namespace :supervisor do
|
4
|
+
desc '(Re-)Generate the supervisor configuration (e.g. for supervisord).'
|
5
|
+
task :gen_config do
|
6
|
+
on roles fetch(:procfile_role, :app) do |host|
|
7
|
+
within release_path do
|
8
|
+
execute :supervisor_gen_config, host.properties.procfile
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
desc 'Reread the supervisor configuration and (re)start all Procfile processes'
|
14
|
+
task :restart_procs do
|
15
|
+
on roles fetch(:procfile_role, :app) do
|
16
|
+
within release_path do
|
17
|
+
execute :supervisor_restart_procs
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
desc 'Stop all Procfile processes in case you want to them to be stopped while your deployment runs'
|
23
|
+
task :stop_procs do
|
24
|
+
on roles fetch(:procfile_role, :app) do
|
25
|
+
within release_path do
|
26
|
+
execute :supervisor_stop_procs
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# Can be used for example to quiet sidekiq with a task like this:
|
32
|
+
#
|
33
|
+
# namespace :sidekiq do
|
34
|
+
# desc 'quiet all sidekiq processes so they stop accepting new jobs.'
|
35
|
+
# task :quiet do
|
36
|
+
# on roles :cron do
|
37
|
+
# # The TSTP signal tells sidekiq to quiet all workers.
|
38
|
+
# # see: https://github.com/mperham/sidekiq/wiki/Signals#tstp
|
39
|
+
# invoke('supervisor:signal_procs', 'TSTP', 'sidekiq')
|
40
|
+
# end
|
41
|
+
# end
|
42
|
+
# end
|
43
|
+
desc 'Sends the signal (e.g. USR1 or TSTP) to all programs or if specified to program_name.'
|
44
|
+
task :signal_procs, :signal, :program_name do |task_name, args|
|
45
|
+
signal = args.fetch(:signal)
|
46
|
+
program_name = args.fetch(:program_name, nil)
|
47
|
+
|
48
|
+
on roles fetch(:procfile_role, :app) do
|
49
|
+
within release_path do
|
50
|
+
if program_name
|
51
|
+
execute :supervisor_signal_procs, signal, program_name
|
52
|
+
else
|
53
|
+
execute :supervisor_signal_procs, signal
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-opscomplete
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Makandra Operations
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: makandra-rubocop
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,6 +81,7 @@ extra_rdoc_files: []
|
|
81
81
|
files:
|
82
82
|
- CHANGELOG.md
|
83
83
|
- Gemfile
|
84
|
+
- Gemfile.lock
|
84
85
|
- LICENSE
|
85
86
|
- README.md
|
86
87
|
- Rakefile
|
@@ -90,13 +91,17 @@ files:
|
|
90
91
|
- lib/capistrano/dsl/opscomplete.rb
|
91
92
|
- lib/capistrano/opscomplete.rb
|
92
93
|
- lib/capistrano/opscomplete/deploy.rake
|
93
|
-
- lib/capistrano/opscomplete/
|
94
|
+
- lib/capistrano/opscomplete/ruby.rake
|
95
|
+
- lib/capistrano/opscomplete/supervisor.rake
|
94
96
|
- lib/capistrano/opscomplete/version.rb
|
95
97
|
homepage: https://opscomplete.com/ruby
|
96
98
|
licenses:
|
97
99
|
- MIT
|
98
100
|
metadata:
|
99
101
|
allowed_push_host: https://rubygems.org
|
102
|
+
bug_tracker_uri: https://github.com/makandra/capistrano-opscomplete/issues
|
103
|
+
changelog_uri: https://github.com/makandra/capistrano-opscomplete/blob/master/CHANGELOG.md
|
104
|
+
source_code_uri: https://github.com/makandra/capistrano-opscomplete
|
100
105
|
post_install_message:
|
101
106
|
rdoc_options: []
|
102
107
|
require_paths:
|
@@ -112,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
117
|
- !ruby/object:Gem::Version
|
113
118
|
version: 2.0.1
|
114
119
|
requirements: []
|
115
|
-
rubygems_version: 3.0.
|
120
|
+
rubygems_version: 3.0.3
|
116
121
|
signing_key:
|
117
122
|
specification_version: 4
|
118
123
|
summary: Capistrano tasks for easy deployment to a makandra opscomplete environment.
|