deploy_tracker 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ pkg/*
2
+ *.gem
3
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in deploy_tracker.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 Andrew Nesbitt
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,6 @@
1
+ Deploy Tracker
2
+ ==============
3
+
4
+ Place the following line at the bottom config/deploy.rb:
5
+
6
+ require 'deploy_tracker/capistrano'
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "deploy_tracker/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "deploy_tracker"
7
+ s.version = DeployTracker::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Andrew Nesbitt"]
10
+ s.email = ["andrewnez@gmail.com"]
11
+ s.homepage = "http://deploytracking.com"
12
+ s.summary = %q{Track deployments to deploytracking.com}
13
+ s.description = %q{Keep a record of all your deployments with interesting stats and history of all deployments with capistrano}
14
+
15
+ s.files = `git ls-files`.split("\n")
16
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
+ s.require_paths = ["lib"]
19
+ end
@@ -0,0 +1,3 @@
1
+ module DeployTracker
2
+
3
+ end
@@ -0,0 +1,46 @@
1
+ require 'net/https'
2
+ # hack to eliminate the SSL certificate verification notification
3
+ class Net::HTTP
4
+ alias_method :old_initialize, :initialize
5
+ def initialize(*args)
6
+ old_initialize(*args)
7
+ @ssl_context = OpenSSL::SSL::SSLContext.new
8
+ @ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
9
+ end
10
+ end
11
+
12
+ Capistrano::Configuration.instance(:must_exist).load do
13
+ after "deploy", "deploy:track"
14
+ after "deploy:migrations", "deploy:track"
15
+
16
+ namespace :deploy do
17
+ desc "Send deployment to deploytracker.com"
18
+ task :track, :except => { :no_release => true } do
19
+ rails_env = fetch(:rails_env, "production")
20
+ executable = RUBY_PLATFORM.downcase.include?('mswin') ? 'rake.bat' : 'rake'
21
+
22
+ puts "[DeployTracker] Tracking Deployment"
23
+
24
+ github_username = `git config --get github.user`.chomp
25
+ throw "[DeployTracker] Please set your github username with...\n\t`git config --global github.user YOUR_GITHUB_USERNAME`." if github_username.size==0
26
+ url = URI.parse('https://deploytracking.heroku.com/deploys')
27
+
28
+ data = "deploy[github_username]=#{github_username}&deploy[environment]=#{rails_env}&deploy[current_revision]=#{current_revision}&deploy[repository]=#{repository}&api_key=#{deploy_tracking_api_key}"
29
+
30
+ http = Net::HTTP.new('deploytracking.heroku.com', 443)
31
+ http.use_ssl = true
32
+ path = '/deploys'
33
+
34
+ headers = {
35
+ 'Content-Type' => 'application/x-www-form-urlencoded'
36
+ }
37
+ resp, data = begin
38
+ http.post(path, data, headers)
39
+ rescue TimeoutError => e
40
+ throw "[DeployTracker] Connection timed out."
41
+ end
42
+ throw "[DeployTracker] Error posting to server." unless resp.is_a?(Net::HTTPSuccess)
43
+ puts "[DeployTracker] Deployment tracked"
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,3 @@
1
+ module DeployTracker
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: deploy_tracker
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Andrew Nesbitt
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-01-27 00:00:00 +00:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: Keep a record of all your deployments with interesting stats and history of all deployments with capistrano
23
+ email:
24
+ - andrewnez@gmail.com
25
+ executables: []
26
+
27
+ extensions: []
28
+
29
+ extra_rdoc_files: []
30
+
31
+ files:
32
+ - .gitignore
33
+ - Gemfile
34
+ - LICENSE
35
+ - README
36
+ - Rakefile
37
+ - deploy_tracker.gemspec
38
+ - lib/deploy_tracker.rb
39
+ - lib/deploy_tracker/capistrano.rb
40
+ - lib/deploy_tracker/version.rb
41
+ has_rdoc: true
42
+ homepage: http://deploytracking.com
43
+ licenses: []
44
+
45
+ post_install_message:
46
+ rdoc_options: []
47
+
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ hash: 3
56
+ segments:
57
+ - 0
58
+ version: "0"
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ none: false
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ hash: 3
65
+ segments:
66
+ - 0
67
+ version: "0"
68
+ requirements: []
69
+
70
+ rubyforge_project:
71
+ rubygems_version: 1.3.7
72
+ signing_key:
73
+ specification_version: 3
74
+ summary: Track deployments to deploytracking.com
75
+ test_files: []
76
+