capistrano-git-plugins 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rvmrc +1 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +15 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +35 -0
- data/VERSION +1 -0
- data/capistrano-git-plugins.gemspec +56 -0
- data/lib/capistrano/git/plugins/airbrake.rb +37 -0
- data/lib/capistrano/git/plugins/bundler.rb +22 -0
- data/lib/capistrano/git/plugins/deploy_reporter.rb +26 -0
- data/lib/capistrano/git/plugins/hoptoad.rb +18 -0
- data/lib/capistrano/git/plugins/kill_resque_workers.rb +11 -0
- data/lib/capistrano/git/plugins/new_relic.rb +13 -0
- data/test/helper.rb +18 -0
- data/test/test_capistrano-git-plugins.rb +7 -0
- metadata +97 -0
data/.document
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use ree-1.8.7-2010.02@capistrano-git-plugins
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Ryan Moran
|
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.rdoc
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
= capistrano-git-plugins
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
== Contributing to capistrano-git-plugins
|
6
|
+
|
7
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
8
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
9
|
+
* Fork the project
|
10
|
+
* Start a feature/bugfix branch
|
11
|
+
* Commit and push until you are happy with your contribution
|
12
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2011 Ryan Moran. See LICENSE.txt for
|
18
|
+
further details.
|
19
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "capistrano-git-plugins"
|
18
|
+
gem.homepage = "https://github.com/RevolutionPrep/capistrano-git-plugins"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Plugins to support capistrano-git deployments}
|
21
|
+
gem.description = %Q{Plugins to support capistrano-git deployments}
|
22
|
+
gem.email = "ryan.moran@gmail.com"
|
23
|
+
gem.authors = ["Ryan Moran"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rake/testtask'
|
29
|
+
Rake::TestTask.new(:test) do |test|
|
30
|
+
test.libs << 'lib' << 'test'
|
31
|
+
test.pattern = 'test/**/test_*.rb'
|
32
|
+
test.verbose = true
|
33
|
+
end
|
34
|
+
|
35
|
+
task :default => :test
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.0
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{capistrano-git-plugins}
|
8
|
+
s.version = "0.0.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = [%q{Ryan Moran}]
|
12
|
+
s.date = %q{2011-11-21}
|
13
|
+
s.description = %q{Plugins to support capistrano-git deployments}
|
14
|
+
s.email = %q{ryan.moran@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".rvmrc",
|
22
|
+
"Gemfile",
|
23
|
+
"Gemfile.lock",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"capistrano-git-plugins.gemspec",
|
29
|
+
"lib/capistrano/git/plugins/airbrake.rb",
|
30
|
+
"lib/capistrano/git/plugins/bundler.rb",
|
31
|
+
"lib/capistrano/git/plugins/deploy_reporter.rb",
|
32
|
+
"lib/capistrano/git/plugins/hoptoad.rb",
|
33
|
+
"lib/capistrano/git/plugins/kill_resque_workers.rb",
|
34
|
+
"lib/capistrano/git/plugins/new_relic.rb",
|
35
|
+
"test/helper.rb",
|
36
|
+
"test/test_capistrano-git-plugins.rb"
|
37
|
+
]
|
38
|
+
s.homepage = %q{https://github.com/RevolutionPrep/capistrano-git-plugins}
|
39
|
+
s.licenses = [%q{MIT}]
|
40
|
+
s.require_paths = [%q{lib}]
|
41
|
+
s.rubygems_version = %q{1.8.6}
|
42
|
+
s.summary = %q{Plugins to support capistrano-git deployments}
|
43
|
+
|
44
|
+
if s.respond_to? :specification_version then
|
45
|
+
s.specification_version = 3
|
46
|
+
|
47
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
48
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
49
|
+
else
|
50
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
51
|
+
end
|
52
|
+
else
|
53
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Airbrake
|
2
|
+
module Capistrano
|
3
|
+
def self.load_into(configuration)
|
4
|
+
configuration.load do
|
5
|
+
after 'deploy', 'airbrake:deploy'
|
6
|
+
after 'deploy:migrations', 'airbrake:deploy'
|
7
|
+
|
8
|
+
namespace :airbrake do
|
9
|
+
desc <<-DESC
|
10
|
+
Notify Airbrake of the deployment by running the notification on the REMOTE machine.
|
11
|
+
- Run remotely so we use remote API keys, environment, etc.
|
12
|
+
DESC
|
13
|
+
task :deploy, :except => { :no_release => true } do
|
14
|
+
rails_env = fetch(:airbrake_env, fetch(:rails_env, 'production'))
|
15
|
+
local_user = ENV['USER'] || ENV['USERNAME']
|
16
|
+
executable = RUBY_PLATFORM.downcase.include?('mswin') ? fetch(:rake, 'rake.bat') : fetch(:rake, 'rake')
|
17
|
+
notify_command = "cd #{deploy_to}; #{executable} RAILS_ENV=#{rails_env} airbrake:deploy TO=#{rails_env} REPO=#{repository} USER=#{local_user}"
|
18
|
+
notify_command << ' DRY_RUN=true' if dry_run
|
19
|
+
notify_command << " API_KEY=#{ENV['API_KEY']}" if ENV['API_KEY']
|
20
|
+
puts "\n\n### NOTIFY AIRBRAKE: Notifying Airbrake of Deploy (#{notify_command})\n\n"
|
21
|
+
if configuration.dry_run
|
22
|
+
puts 'DRY RUN: Notification not actually run.'
|
23
|
+
else
|
24
|
+
result = ''
|
25
|
+
run(notify_command, :once => true) { |ch, stream, data| result << data }
|
26
|
+
end
|
27
|
+
puts 'Airbrake Notification Complete.'
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
if Capistrano::Configuration.instance
|
36
|
+
Airbrake::Capistrano.load_into(Capistrano::Configuration.instance)
|
37
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
+
after 'deploy:update_code', 'deploy:bundle:build'
|
3
|
+
|
4
|
+
namespace :deploy do
|
5
|
+
namespace :bundle do
|
6
|
+
desc 'Bundles the gems into the repo'
|
7
|
+
task :build, :except => { :no_release => true } do
|
8
|
+
puts "\n\n### BUNDLE GEMS: Bundling up gems into vendor/bundle\n\n"
|
9
|
+
args = ["--deployment"]
|
10
|
+
args << "--without #{bundle_without.join(" ")}" unless bundle_without.empty?
|
11
|
+
run "cd #{deploy_to} && sudo -u #{sudo_user} #{ruby_bin_dir}/bundle install #{args.join(' ')}"
|
12
|
+
end
|
13
|
+
|
14
|
+
desc 'Wipes out and rebundles the gems into the repo'
|
15
|
+
task :rebuild, :except => { :no_release => true } do
|
16
|
+
puts "\n\n### REBUILDING BUNDLE!: Wiping the existing bundle and rebuilding from scratch...\n\n"
|
17
|
+
run "sudo rm -rf #{deploy_to}/vendor/bundle"
|
18
|
+
bundle_gems
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
|
3
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
4
|
+
after 'deploy', 'deploy:report'
|
5
|
+
after 'deploy:migrations', 'deploy:report'
|
6
|
+
|
7
|
+
namespace :deploy do
|
8
|
+
desc "Report that the deployment was made"
|
9
|
+
task :report, :except => { :no_release => true } do
|
10
|
+
local_user = ENV['USER'] || ENV['USERNAME']
|
11
|
+
puts "\n\n### REPORT DEPLOYMENT: Reporting deployment to deployment tracking system\n\n"
|
12
|
+
url = URI.parse('http://fierce-samurai-448.heroku.com/deployments')
|
13
|
+
req = Net::HTTP::Post.new(url.path)
|
14
|
+
req.set_form_data({ 'deployment[deployer]' => local_user, 'deployment[project_name]' => application }, ';')
|
15
|
+
res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
|
16
|
+
case res
|
17
|
+
when Net::HTTPSuccess, Net::HTTPRedirection
|
18
|
+
# OK
|
19
|
+
else
|
20
|
+
res.error!
|
21
|
+
end
|
22
|
+
# system 'open http://fierce-samurai-448.heroku.com/deployments'
|
23
|
+
puts 'Deployment reported.'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
+
after 'deploy', 'deploy:notify_hoptoad'
|
3
|
+
after 'deploy:migrations', 'deploy:notify_hoptoad'
|
4
|
+
|
5
|
+
namespace :deploy do
|
6
|
+
desc 'Notify Hoptoad of the deployment'
|
7
|
+
task :notify_hoptoad, :except => { :no_release => true } do
|
8
|
+
rails_env = fetch(:hoptoad_env, fetch(:rails_env, 'production'))
|
9
|
+
local_user = ENV['USER'] || ENV['USERNAME']
|
10
|
+
executable = RUBY_PLATFORM.downcase.include?('mswin') ? 'rake.bat' : 'rake'
|
11
|
+
notify_command = "#{executable} hoptoad:deploy TO=#{rails_env} REPO=#{repository} USER=#{local_user}"
|
12
|
+
notify_command << " API_KEY=#{ENV['API_KEY']}" if ENV['API_KEY']
|
13
|
+
puts "\n\n### NOTIFY HOPTOAD: Notifying Hoptoad of Deploy (#{notify_command})\n\n"
|
14
|
+
`#{notify_command}`
|
15
|
+
puts 'Hoptoad Notification Complete.'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
+
after 'deploy:restart', 'resque_workers:restart'
|
3
|
+
|
4
|
+
namespace :resque_workers do
|
5
|
+
desc 'restart resque workers'
|
6
|
+
task :restart, :roles=> :god do
|
7
|
+
puts "\n\n### RESTART RESQUE WORKERS!: Killing the resque workers, God will resurrect them.\n\n"
|
8
|
+
run "sudo #{deploy_to}/config/god/kill_resque_workers.sh"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
+
before 'deploy:restart', 'deploy:new_relic:enable'
|
3
|
+
|
4
|
+
namespace :deploy do
|
5
|
+
namespace :new_relic do
|
6
|
+
desc 'Enable New Relic on :monitored servers'
|
7
|
+
task :enable, :roles => :web do
|
8
|
+
puts "\n\n### NEW RELIC: Enabling!\n\n"
|
9
|
+
run "sudo cp #{deploy_to}/config/newrelic.enable.yml #{deploy_to}/config/newrelic.yml"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/test/helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'test/unit'
|
11
|
+
require 'shoulda'
|
12
|
+
|
13
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
+
require 'capistrano-git-plugins'
|
16
|
+
|
17
|
+
class Test::Unit::TestCase
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-git-plugins
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 31
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 0.0.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Ryan Moran
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-11-21 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
22
|
+
none: false
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
hash: 7
|
27
|
+
segments:
|
28
|
+
- 1
|
29
|
+
- 6
|
30
|
+
- 4
|
31
|
+
version: 1.6.4
|
32
|
+
version_requirements: *id001
|
33
|
+
name: jeweler
|
34
|
+
prerelease: false
|
35
|
+
type: :development
|
36
|
+
description: Plugins to support capistrano-git deployments
|
37
|
+
email: ryan.moran@gmail.com
|
38
|
+
executables: []
|
39
|
+
|
40
|
+
extensions: []
|
41
|
+
|
42
|
+
extra_rdoc_files:
|
43
|
+
- LICENSE.txt
|
44
|
+
- README.rdoc
|
45
|
+
files:
|
46
|
+
- .document
|
47
|
+
- .rvmrc
|
48
|
+
- Gemfile
|
49
|
+
- Gemfile.lock
|
50
|
+
- LICENSE.txt
|
51
|
+
- README.rdoc
|
52
|
+
- Rakefile
|
53
|
+
- VERSION
|
54
|
+
- capistrano-git-plugins.gemspec
|
55
|
+
- lib/capistrano/git/plugins/airbrake.rb
|
56
|
+
- lib/capistrano/git/plugins/bundler.rb
|
57
|
+
- lib/capistrano/git/plugins/deploy_reporter.rb
|
58
|
+
- lib/capistrano/git/plugins/hoptoad.rb
|
59
|
+
- lib/capistrano/git/plugins/kill_resque_workers.rb
|
60
|
+
- lib/capistrano/git/plugins/new_relic.rb
|
61
|
+
- test/helper.rb
|
62
|
+
- test/test_capistrano-git-plugins.rb
|
63
|
+
homepage: https://github.com/RevolutionPrep/capistrano-git-plugins
|
64
|
+
licenses:
|
65
|
+
- MIT
|
66
|
+
post_install_message:
|
67
|
+
rdoc_options: []
|
68
|
+
|
69
|
+
require_paths:
|
70
|
+
- lib
|
71
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
hash: 3
|
77
|
+
segments:
|
78
|
+
- 0
|
79
|
+
version: "0"
|
80
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
hash: 3
|
86
|
+
segments:
|
87
|
+
- 0
|
88
|
+
version: "0"
|
89
|
+
requirements: []
|
90
|
+
|
91
|
+
rubyforge_project:
|
92
|
+
rubygems_version: 1.8.6
|
93
|
+
signing_key:
|
94
|
+
specification_version: 3
|
95
|
+
summary: Plugins to support capistrano-git deployments
|
96
|
+
test_files: []
|
97
|
+
|