capistrano-data_plane_api 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7fc6970b104cd14cd0c2bc3fc0c7a36e3f67ecb73f304f14cc73bce48d42d97
4
- data.tar.gz: 7a08a4712fb0690eaf2894f07bf17de9851afe2911c496ab5f365ca2dfd35a53
3
+ metadata.gz: 297cd22ece0e041f4f66d9cc3152f484e3ae8b12521f90904231201fce8ab926
4
+ data.tar.gz: 40f67d1856921f004299cc98f536f4de2a9a9f5c50a5871a2bac73f860cfd74f
5
5
  SHA512:
6
- metadata.gz: 0b8db27dccc0af104a2418a2c17e62c30eb7fcdba9aed373ec6789949e3536f245565e367f80bdbd44b0b570f4baba242a81ded2bbdfaaf888626b5107af0c2f
7
- data.tar.gz: 9fc7f0551def684dee3a6764c727b61b3bbf7b5873baea9b82de85c23e8bff0b904ccde363896e5f74b791f98f67cc66bbe08cb69b112af3ca4790ec746f4444
6
+ metadata.gz: 40544833867016abbd903eda2ae793e8ba8ec6c561d7d5d8358f1c0cd4b063acf6235c9dcc54027b3718f62e405fb0519df835a096867776bb6888d1425a9531
7
+ data.tar.gz: 5e0e7a3ccc2a118d3161542f0a31fde548ee5b7e228aa7b92936b109095bc46d1f3dd70df2847ebf2e5821eff6773d4967fc21bccfdac8be928d13a6ce4e34ce
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano-data_plane_api (0.1.3)
4
+ capistrano-data_plane_api (0.1.5)
5
5
  data_plane_api (~> 0.1)
6
6
  pastel (< 1)
7
7
  shale (>= 1, < 2)
data/README.md CHANGED
@@ -155,6 +155,8 @@ add this line to your `Capfile`
155
155
  require 'capistrano/data_plane_api'
156
156
  ```
157
157
 
158
+ These tasks will only run when the `:web` role is added to the deployment stage.
159
+
158
160
  ## Hooks
159
161
 
160
162
  If you used the installer, your app is already
@@ -188,6 +190,8 @@ deploy
188
190
  data_plane_api:server:set_ready
189
191
  ```
190
192
 
193
+ These tasks will only run when the `:web` role is added to the deployment stage.
194
+
191
195
  ## Development
192
196
 
193
197
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -6,25 +6,31 @@ namespace :data_plane_api do
6
6
  namespace :server do
7
7
  desc "Set the server's admin state to DRAIN through the HAProxy Data Plane API"
8
8
  task :set_drain do
9
- next if ::Capistrano::DataPlaneApi.no_haproxy?
9
+ on roles :web do
10
+ next if ::Capistrano::DataPlaneApi.no_haproxy?
10
11
 
11
- ::Capistrano::DataPlaneApi.server_set_drain fetch(:stage), force: ::Capistrano::DataPlaneApi.force_haproxy?
12
+ ::Capistrano::DataPlaneApi.server_set_drain fetch(:stage), force: ::Capistrano::DataPlaneApi.force_haproxy?
13
+ end
12
14
  end
13
15
 
14
16
  desc "Set the server's admin state to READY through the HAProxy Data Plane API"
15
17
  task :set_ready do
16
- next if ::Capistrano::DataPlaneApi.no_haproxy?
18
+ on roles :web do
19
+ next if ::Capistrano::DataPlaneApi.no_haproxy?
17
20
 
18
- sleep 3
19
- ::Capistrano::DataPlaneApi.server_set_ready fetch(:stage)
21
+ sleep 3
22
+ ::Capistrano::DataPlaneApi.server_set_ready fetch(:stage)
23
+ end
20
24
  end
21
25
 
22
26
  desc "Set the server's admin state to MAINT through the HAProxy Data Plane API"
23
27
  task :set_maint do
24
- next if ::Capistrano::DataPlaneApi.no_haproxy?
28
+ on roles :web do
29
+ next if ::Capistrano::DataPlaneApi.no_haproxy?
25
30
 
26
- sleep 3
27
- ::Capistrano::DataPlaneApi.server_set_maint fetch(:stage), force: true
31
+ sleep 3
32
+ ::Capistrano::DataPlaneApi.server_set_maint fetch(:stage), force: true
33
+ end
28
34
  end
29
35
  end
30
36
  end
@@ -3,6 +3,6 @@
3
3
  module Capistrano
4
4
  module DataPlaneApi
5
5
  # @return [String]
6
- VERSION = '0.1.3'
6
+ VERSION = '0.1.5'
7
7
  end
8
8
  end
@@ -266,11 +266,6 @@ module Capistrano
266
266
  # @return [void]
267
267
  def validate_backend_state(haproxy_backend, haproxy_server)
268
268
  response = get_backend_servers_settings(haproxy_backend.name)
269
- unless haproxy_backend.servers.length == response.body.length
270
- raise QueryError,
271
- 'HAProxy query failed! Configured servers for this backend' \
272
- "don't match the configuration file! `#{configuration.file_path}`"
273
- end
274
269
 
275
270
  # @type [Array<Hash>]
276
271
  server_statuses = response.body
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.3
4
+ version: 0.1.5
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: 2023-08-25 00:00:00.000000000 Z
12
+ date: 2024-09-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: data_plane_api