Sha256: c1cba6d1b42636aed4b50625ef1712b041df00e183f77fc0d5afc42e5c98c95a

Contents?: true

Size: 1.42 KB

Versions: 43

Compression:

Stored size: 1.42 KB

Contents

module Publisher
  class Iis_build
    attr_accessor :iis_build_url
    attr_accessor :iis_build_protocol
    attr_accessor :http_read_timeout

    def build(tag, env, version, value, application_name)
      Helper.validates_presence_of iis_build_url, "IIS URL not set"
      Helper.validates_presence_of iis_build_protocol, "Protocol not set"
      iis_error = false

      begin
        uri    = URI(iis_build_protocol + '://' + iis_build_url)
        Net::HTTP.start(uri.host, uri.port) do |http|
          http.read_timeout = http_read_timeout
          request = Net::HTTP::Post.new uri.request_uri
          request.set_form_data('tag' => tag, 'env' => env, 'version' => version, 'value' => value, 'application_name' => application_name)
          request.content_type = 'application/x-www-form-urlencoded;charset=utf-8'
          http.request request do |response|
            response.read_body do |chunk|
              if chunk.include?("### Error while executing")
                $log.writer.error "Error executing build on IIS"
                iis_error = true
              end
              $log.writer.info "#{chunk}"
            end
          end
        end
      rescue Exception => e
        $log.writer.error "Error: while connecting to IIS Server"
        $log.writer.error "Request was: #{uri.to_s}"
        $log.writer.error e.message
        exit 1
      end
      
      if iis_error
        exit 1
      end

    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
depengine-0.0.24 lib/depengine/publisher/iis_build.rb
depengine-0.0.23 lib/depengine/publisher/iis_build.rb
depengine-0.0.22 lib/depengine/publisher/iis_build.rb
depengine-0.0.21 lib/depengine/publisher/iis_build.rb
depengine-0.0.20 lib/depengine/publisher/iis_build.rb
depengine-0.0.19 lib/depengine/publisher/iis_build.rb
depengine-0.0.18 lib/depengine/publisher/iis_build.rb
depengine-0.0.17 lib/depengine/publisher/iis_build.rb
depengine-0.0.16 lib/depengine/publisher/iis_build.rb
depengine-0.0.15 lib/depengine/publisher/iis_build.rb
depengine-0.0.14 lib/depengine/publisher/iis_build.rb
depengine-0.0.13 lib/depengine/publisher/iis_build.rb
depengine-0.0.12 lib/depengine/publisher/iis_build.rb
depengine-0.0.11 lib/depengine/publisher/iis_build.rb
depengine-0.0.10 lib/depengine/publisher/iis_build.rb
depengine-0.0.9 lib/depengine/publisher/iis_build.rb
depengine-0.0.8 lib/depengine/publisher/iis_build.rb
depengine-0.0.7 lib/depengine/publisher/iis_build.rb
depengine-0.0.5 lib/depengine/publisher/iis_build.rb
depengine-0.0.4 lib/depengine/publisher/iis_build.rb