Sha256: 6416e033dbe2fa11bfa4c8f4d35387554ce24507854acd7c3c9a69745d315b1d

Contents?: true

Size: 858 Bytes

Versions: 9

Compression:

Stored size: 858 Bytes

Contents

# frozen_string_literal: true

module Dpl
  module Providers
    class Cloud66 < Provider
      register :cloud66

      status :alpha

      description sq(<<-STR)
        tbd
      STR

      env :cloud66

      opt '--redeployment_hook URL', 'The redeployment hook URL', required: true, secret: true

      msgs failed: 'Redeployment failed (%s)'

      def deploy
        response = client.request(request)
        error :failed, response.code if response.code != '200'
      end

      private

      def client
        Net::HTTP.new(uri.host, uri.port).tap do |client|
          client.use_ssl = use_ssl?
        end
      end

      def request
        Net::HTTP::Post.new(uri.path)
      end

      def uri
        @uri ||= URI.parse(redeployment_hook)
      end

      def use_ssl?
        uri.scheme.downcase == 'https'
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
dpl-2.0.5.3 lib/dpl/providers/cloud66.rb
dpl-2.0.5.3.beta.1 lib/dpl/providers/cloud66.rb
dpl-2.0.5.beta.2.1 lib/dpl/providers/cloud66.rb
dpl-2.0.5.beta.2 lib/dpl/providers/cloud66.rb
dpl-2.0.5 lib/dpl/providers/cloud66.rb
dpl-2.0.5.beta.1 lib/dpl/providers/cloud66.rb
dpl-2.0.5.beta lib/dpl/providers/cloud66.rb
travis_dpl_test-2.0.3.beta.4.ror.1 lib/dpl/providers/cloud66.rb
travis_dpl_test-2.0.3.beta.4.ror lib/dpl/providers/cloud66.rb