Sha256: 9a20ed57bc24f879d6ba5569c2d55c921892744172cb71486d23eed99ed6d51c

Contents?: true

Size: 901 Bytes

Versions: 3

Compression:

Stored size: 901 Bytes

Contents

# frozen_string_literal: true

require 'rake'

namespace :data_plane_api do
  namespace :server do
    desc "Set the server's admin state to DRAIN through the HAProxy Data Plane API"
    task :set_drain do
      next if ::Capistrano::DataPlaneApi.no_haproxy?

      ::Capistrano::DataPlaneApi.server_set_drain fetch(:stage), force: ::Capistrano::DataPlaneApi.force_haproxy?
    end

    desc "Set the server's admin state to READY through the HAProxy Data Plane API"
    task :set_ready do
      next if ::Capistrano::DataPlaneApi.no_haproxy?

      sleep 3
      ::Capistrano::DataPlaneApi.server_set_ready fetch(:stage)
    end

    desc "Set the server's admin state to MAINT through the HAProxy Data Plane API"
    task :set_maint do
      next if ::Capistrano::DataPlaneApi.no_haproxy?

      sleep 3
      ::Capistrano::DataPlaneApi.server_set_maint fetch(:stage), force: true
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
capistrano-data_plane_api-0.1.3 lib/capistrano/data_plane_api/tasks.rb
capistrano-data_plane_api-0.1.2 lib/capistrano/data_plane_api/tasks.rb
capistrano-data_plane_api-0.1.1 lib/capistrano/data_plane_api/tasks.rb