capistrano-data_plane_api 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +8 -2
- data/capistrano-data_plane_api.gemspec +1 -1
- data/lib/capistrano/data_plane_api/deploy/deployment_stats.rb +2 -2
- data/lib/capistrano/data_plane_api/deploy/server_stats.rb +2 -0
- data/lib/capistrano/data_plane_api/helper.rb +2 -0
- data/lib/capistrano/data_plane_api/version.rb +1 -1
- data/templates/config/data_plane_api.yml +1 -0
- metadata +11 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7fc6970b104cd14cd0c2bc3fc0c7a36e3f67ecb73f304f14cc73bce48d42d97
|
4
|
+
data.tar.gz: 7a08a4712fb0690eaf2894f07bf17de9851afe2911c496ab5f365ca2dfd35a53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b8db27dccc0af104a2418a2c17e62c30eb7fcdba9aed373ec6789949e3536f245565e367f80bdbd44b0b570f4baba242a81ded2bbdfaaf888626b5107af0c2f
|
7
|
+
data.tar.gz: 9fc7f0551def684dee3a6764c727b61b3bbf7b5873baea9b82de85c23e8bff0b904ccde363896e5f74b791f98f67cc66bbe08cb69b112af3ca4790ec746f4444
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
capistrano-data_plane_api (0.1.
|
4
|
+
capistrano-data_plane_api (0.1.3)
|
5
5
|
data_plane_api (~> 0.1)
|
6
6
|
pastel (< 1)
|
7
|
-
shale (<
|
7
|
+
shale (>= 1, < 2)
|
8
8
|
thor (> 1, < 2)
|
9
9
|
tty-box (< 1)
|
10
10
|
tty-cursor (< 1)
|
@@ -68,7 +68,7 @@ GEM
|
|
68
68
|
rubocop
|
69
69
|
ruby-progressbar (1.11.0)
|
70
70
|
ruby2_keywords (0.0.5)
|
71
|
-
shale (0.
|
71
|
+
shale (1.0.0)
|
72
72
|
shoulda-context (2.0.0)
|
73
73
|
solargraph (0.48.0)
|
74
74
|
backport (~> 1.2)
|
data/README.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
# Capistrano::DataPlaneApi
|
2
2
|
|
3
|
-
Capistrano plugin which helps you
|
3
|
+
[Capistrano](https://capistranorb.com/) plugin which helps you
|
4
|
+
automatically change the admin state of your [HAProxy](https://www.haproxy.com/)
|
5
|
+
servers using the [Data Plane API](https://www.haproxy.com/documentation/dataplaneapi/community/).
|
6
|
+
|
7
|
+
[Capistrano](https://capistranorb.com/) is a remote server automation and deployment tool.
|
8
|
+
[HAProxy](https://www.haproxy.com/) is a load balancer.
|
4
9
|
|
5
10
|
## Installation
|
6
11
|
|
@@ -32,7 +37,8 @@ $ bundle exec cap_data_plane_api install
|
|
32
37
|
|
33
38
|
This gem hooks into capistrano to add new tasks which
|
34
39
|
enable you to change the admin state of your HAProxy
|
35
|
-
servers during the deployment process
|
40
|
+
servers during the deployment process
|
41
|
+
using using the [Data Plane API](https://www.haproxy.com/documentation/dataplaneapi/community/).
|
36
42
|
|
37
43
|
We recommend creating separate Capistrano stages
|
38
44
|
for every HAProxy server.
|
@@ -32,7 +32,7 @@ require_relative 'lib/capistrano/data_plane_api/version'
|
|
32
32
|
# Uncomment to register a new dependency of your gem
|
33
33
|
spec.add_dependency 'data_plane_api', '~> 0.1'
|
34
34
|
spec.add_dependency 'pastel', '< 1'
|
35
|
-
spec.add_dependency 'shale', '
|
35
|
+
spec.add_dependency 'shale', '>= 1', '< 2'
|
36
36
|
spec.add_dependency 'thor', '> 1', '< 2'
|
37
37
|
spec.add_dependency 'tty-box', '< 1'
|
38
38
|
spec.add_dependency 'tty-cursor', '< 1'
|
@@ -100,10 +100,10 @@ module Capistrano
|
|
100
100
|
nil
|
101
101
|
end
|
102
102
|
|
103
|
-
return
|
103
|
+
return if server_states.nil?
|
104
104
|
|
105
105
|
server_states.each do |server_state|
|
106
|
-
@server_stats[server_state['name']]&.
|
106
|
+
@server_stats[server_state['name']]&.tap do |s|
|
107
107
|
s.admin_state = server_state['admin_state']
|
108
108
|
s.operational_state = server_state['operational_state']
|
109
109
|
end
|
@@ -6,6 +6,7 @@ module Capistrano
|
|
6
6
|
module Helper
|
7
7
|
# @return [Hash{String => Symbol}]
|
8
8
|
ADMIN_STATE_COLORS = {
|
9
|
+
'unknown' => :on_red,
|
9
10
|
'drain' => :on_blue,
|
10
11
|
'ready' => :on_green,
|
11
12
|
'maint' => :on_yellow
|
@@ -13,6 +14,7 @@ module Capistrano
|
|
13
14
|
|
14
15
|
# @return [Hash{String => Symbol}]
|
15
16
|
OPERATIONAL_STATE_COLORS = {
|
17
|
+
'unknown' => :on_red,
|
16
18
|
'up' => :on_green,
|
17
19
|
'down' => :on_red,
|
18
20
|
'stopping' => :on_yellow
|
@@ -13,6 +13,7 @@ basic_password: my_password # Data Plane API BasicAuth password
|
|
13
13
|
|
14
14
|
# List of HAProxy backends
|
15
15
|
backends:
|
16
|
+
|
16
17
|
- name: back_production # your HAProxy backend name
|
17
18
|
# styles defined in the `Pastel` gem, used in the terminal to uniquely identify this backend
|
18
19
|
# by coloring its name.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-data_plane_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mateusz Drewniak
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-08-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: data_plane_api
|
@@ -43,16 +43,22 @@ dependencies:
|
|
43
43
|
name: shale
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- - "
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '1'
|
49
|
+
- - "<"
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '2'
|
49
52
|
type: :runtime
|
50
53
|
prerelease: false
|
51
54
|
version_requirements: !ruby/object:Gem::Requirement
|
52
55
|
requirements:
|
53
|
-
- - "
|
56
|
+
- - ">="
|
54
57
|
- !ruby/object:Gem::Version
|
55
58
|
version: '1'
|
59
|
+
- - "<"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2'
|
56
62
|
- !ruby/object:Gem::Dependency
|
57
63
|
name: thor
|
58
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -169,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
175
|
- !ruby/object:Gem::Version
|
170
176
|
version: '0'
|
171
177
|
requirements: []
|
172
|
-
rubygems_version: 3.4.
|
178
|
+
rubygems_version: 3.4.3
|
173
179
|
signing_key:
|
174
180
|
specification_version: 4
|
175
181
|
summary: Capistrano plugin which helps you automatically change the admin state of
|