Sha256: fc2b8a87fe0c5deb754b09d04307ad69df6444ea2a94d3e1e8cfca8145545355

Contents?: true

Size: 747 Bytes

Versions: 612

Compression:

Stored size: 747 Bytes

Contents

require 'net/http'
require 'net/https'

module DPL
  class Provider
    class Cloud66 < Provider
      def needs_key?
        false
      end

      def push_app
        uri = URI.parse(redeployment_hook)

        response = webhook_call(uri.scheme, uri.host, uri.port, uri.path)

        error("Redeployment failed [#{response.code}]") if response.code != '200'
      end

      def check_auth
      end

      private

      def webhook_call(scheme, host, port, path)
        http = Net::HTTP.new(host, port)
        http.use_ssl = (scheme.downcase == 'https')

        request = Net::HTTP::Post.new(path)

        return http.request(request)
      end

      def redeployment_hook
        option(:redeployment_hook)
      end
    end
  end
end

Version data entries

612 entries across 612 versions & 3 rubygems

Version Path
dpl-cloud66-1.10.3.travis.3002.6 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.10.2.travis.2993.6 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.10.2.travis.2992.6 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.10.2.travis.2987.6 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.10.2.travis.2979.6 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.10.2.travis.2976.6 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.10.1 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.10.2.travis.2966.6 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.10.1.travis.2957.6 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.10.1.travis.2956.6 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.10.1.travis.2947.6 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.10.0 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.10.1.travis.2932.6 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.9.8 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.9.9.travis.2894.6 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.9.8.travis.2891.6 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.9.7 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.9.8.travis.2863.6 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.9.7.travis.2857.6 lib/dpl/provider/cloud66.rb
dpl-cloud66-1.9.7.travis.2853.6 lib/dpl/provider/cloud66.rb