Sha256: 24803531bb772724768543a1388c7b9f0d0fac4a7b2629b604e38808b8a156f4
Contents?: true
Size: 1.16 KB
Versions: 2
Compression:
Stored size: 1.16 KB
Contents
require 'net/https' require 'deploytracking/version' module DeployTracking # Send data via a secure socket USE_SSL = true # The domain name of the deploytracking web app DEPLOY_TRACKING_HOST = 'deploytracking.heroku.com' # The relative end point of the service DEPLOY_TRACKING_PATH = '/deploys' # SSL port number that the service is available on DEPLOY_TRACKING_PORT = 443 # Notify the deploytracking webservice of a new deployment # with a payload of data from capistrano. def self.notify(api_key, data) puts "[DeployTracking] Tracking Deployment to #{DEPLOY_TRACKING_HOST}" params = {'api_key' => api_key, 'deploy["gem_version"]' => DeployTracking::VERSION} data.each {|k,v| params["deploy[#{k}]"] = v } http = Net::HTTP.new(DEPLOY_TRACKING_HOST, DEPLOY_TRACKING_PORT) http.use_ssl = USE_SSL http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Post.new(DEPLOY_TRACKING_PATH) request.set_form_data(params) response = http.request(request) throw "[DeployTracking] Error posting to server." unless response.is_a?(Net::HTTPSuccess) puts "[DeployTracking] Deployment tracked" return response end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
deploytracking-0.0.9 | lib/deploytracking.rb |
deploytracking-0.0.8 | lib/deploytracking.rb |