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