capistrano-cowboy 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem "capistrano"
4
+
5
+ group :development do
6
+ gem "rspec", "~> 2.0.0"
7
+ gem "bundler", "~> 1.0.0"
8
+ gem "jeweler", "~> 1.5.0.pre5"
9
+ gem "rcov", ">= 0"
10
+ end
@@ -0,0 +1,45 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ capistrano (2.5.17)
5
+ highline
6
+ net-scp (>= 1.0.0)
7
+ net-sftp (>= 2.0.0)
8
+ net-ssh (>= 2.0.14)
9
+ net-ssh-gateway (>= 1.0.0)
10
+ diff-lcs (1.1.2)
11
+ git (1.2.5)
12
+ highline (1.5.2)
13
+ jeweler (1.5.0.pre5)
14
+ bundler (~> 1.0.0)
15
+ git (>= 1.2.5)
16
+ rake
17
+ net-scp (1.0.2)
18
+ net-ssh (>= 1.99.1)
19
+ net-sftp (2.0.4)
20
+ net-ssh (>= 2.0.9)
21
+ net-ssh (2.0.23)
22
+ net-ssh-gateway (1.0.1)
23
+ net-ssh (>= 1.99.1)
24
+ rake (0.8.7)
25
+ rcov (0.9.9)
26
+ rspec (2.0.1)
27
+ rspec-core (~> 2.0.1)
28
+ rspec-expectations (~> 2.0.1)
29
+ rspec-mocks (~> 2.0.1)
30
+ rspec-core (2.0.1)
31
+ rspec-expectations (2.0.1)
32
+ diff-lcs (>= 1.1.2)
33
+ rspec-mocks (2.0.1)
34
+ rspec-core (~> 2.0.1)
35
+ rspec-expectations (~> 2.0.1)
36
+
37
+ PLATFORMS
38
+ ruby
39
+
40
+ DEPENDENCIES
41
+ bundler (~> 1.0.0)
42
+ capistrano
43
+ jeweler (~> 1.5.0.pre5)
44
+ rcov
45
+ rspec (~> 2.0.0)
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 Joshua Nichols
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.
@@ -0,0 +1,86 @@
1
+ = capistrano-cowboy
2
+
3
+ DISCLAIMER: Deploying like a cowboy can be fun, but dangerous. Use with care!
4
+
5
+ Sometimes, you just need to get your code out there. There's not time for version control, there's not time for committing. capistrano-cowboy let's you deploy like you shoot: from the hip.
6
+
7
+ $ gem install capistrano-cowboy
8
+
9
+ Create or update your ~/.caprc to also contain this line:
10
+
11
+ require 'capistrano/cowboy'
12
+
13
+ Now it's time to ship it!
14
+
15
+ project $ cap cowboy deploy
16
+
17
+ Calling the `cowboy` task overrides any scm configuration you may have configured for capistrano. Instead, it uses the {copy deploy strategy}[http://rdoc.info/github/capistrano/capistrano/master/Capistrano/Deploy/Strategy/Copy], tarring the current directory and sending it over the line.
18
+
19
+ This plays nice with capistrano-ext's multistage support too, but you have to be be careful of the order. You need to call `cowboy` after the stage:
20
+
21
+ project $ cap staging cowboy deploy
22
+
23
+ == Use Cases
24
+
25
+ As dangerous as this sounds, there are some specific use cases it's great for:
26
+
27
+ * developing and testing system automation that's part your normal capistrano deploy (ie using {chef}[http://opscode.com/chef/], {puppet}[http://www.puppetlabs.com/], or even *shock* {moonshine}[http://github.com/railsmachine/moonshine])
28
+ * developing features that are reliant on a non-development environment that'd that might be trial-and-error heavy
29
+ * deploying stuff that doesn't even have version control yet
30
+
31
+ Basically, it's useful when you need to get code or configuration working that might take a few tries to get straight. It has a few benefits:
32
+
33
+ * faster feedback cycle
34
+ * less chance of commit log with messages like "Fixing foo", "Fixing foo again...", "Really fixing foo", etc.
35
+
36
+ == Cavaets
37
+
38
+ === Danger, danger!
39
+ capistrano-cowboy will deploy your current directory, no matter which branch you are on, what's in it, etc. Imagine this nightmare scneario:
40
+
41
+ $ git checkout crazy-experimental-stuff
42
+ $ cap production cowboy deploy
43
+
44
+ Yep, you just accidentally the entire crazy experimental branch.
45
+
46
+ === git ignored files
47
+
48
+ Many projects choose to git-ignore config/database.yml, and have it symlinked it at deploy time. By using capistrano-cowboy, this file will actually exist on the server, and capistrano will not try to override it with a symlink.
49
+
50
+ Be warned, weird stuff might happen if you cowboy up your config/database.yml or other git ignored files.
51
+
52
+ That said, this section is probably a patch away from going away.
53
+
54
+ === slowwww dowwwwwn
55
+
56
+ The :copy deploy method creates a tarball and scp's it to your server. While capistrano-cowboy tries to exclude junk it doesn't need to send over, the tarballs can get big.
57
+
58
+ This can lead to slowish deploys, depending on your upload speeds.
59
+
60
+ === symlinks
61
+
62
+ If for some reason you have symlinks in your local directory, this will also be included in the tarball that's uploaded. The target of the symlink is almost definitely not going to exist on the server.
63
+
64
+
65
+ == Contributing to capistrano-cowboy
66
+
67
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
68
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
69
+ * Fork the project
70
+ * Start a feature/bugfix branch
71
+ * Commit and push until you are happy with your contribution
72
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
73
+ * 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.
74
+
75
+ == Credits
76
+
77
+ {Rob Lingle}[https://github.com/roblingle] for the original idea
78
+
79
+ {Jesse Newland}[http://github.com/jnewland] for codifying it at as gist: https://gist.github.com/542617
80
+
81
+ {Josh Nichols}[http://github.com/technicalpickles] for geming it up
82
+
83
+ == Copyright
84
+
85
+ Copyright (c) 2010 Jesse Newland and Joshua Nichols. See LICENSE.txt for further details.
86
+
@@ -0,0 +1,46 @@
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 'rake'
11
+
12
+ require 'jeweler'
13
+ Jeweler::Tasks.new do |gem|
14
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
+ gem.name = "capistrano-cowboy"
16
+ gem.version = "0.1.1"
17
+ gem.summary = %Q{Deploy like a cowboy}
18
+ gem.description = %Q{capistrano-cowboy let's you deploy without having to commit to version control. While dangerous, this can be incredibly useful for testing the ops-related parts of a deploy}
19
+ gem.email = "jesse@railsmachine.com"
20
+ gem.homepage = "http://github.com/railsmachine/capistrano-cowboy"
21
+ gem.authors = ["Jesse Newland"]
22
+ end
23
+ Jeweler::RubygemsDotOrgTasks.new
24
+
25
+ require 'rspec/core'
26
+ require 'rspec/core/rake_task'
27
+ RSpec::Core::RakeTask.new(:spec) do |spec|
28
+ spec.pattern = FileList['spec/**/*_spec.rb']
29
+ end
30
+
31
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
32
+ spec.pattern = 'spec/**/*_spec.rb'
33
+ spec.rcov = true
34
+ end
35
+
36
+ task :default => :spec
37
+
38
+ require 'rake/rdoctask'
39
+ Rake::RDocTask.new do |rdoc|
40
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
41
+
42
+ rdoc.rdoc_dir = 'rdoc'
43
+ rdoc.title = "capistrano-cowboy #{version}"
44
+ rdoc.rdoc_files.include('README*')
45
+ rdoc.rdoc_files.include('lib/**/*.rb')
46
+ end
@@ -0,0 +1,67 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{capistrano-cowboy}
8
+ s.version = "0.1.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Jesse Newland"]
12
+ s.date = %q{2010-12-01}
13
+ s.description = %q{capistrano-cowboy let's you deploy without having to commit to version control. While dangerous, this can be incredibly useful for testing the ops-related parts of a deploy}
14
+ s.email = %q{jesse@railsmachine.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".rspec",
22
+ "Gemfile",
23
+ "Gemfile.lock",
24
+ "LICENSE.txt",
25
+ "README.rdoc",
26
+ "Rakefile",
27
+ "capistrano-cowboy.gemspec",
28
+ "lib/capistrano-cowboy.rb",
29
+ "lib/capistrano/cowboy.rb",
30
+ "spec/capistrano-cowboy_spec.rb",
31
+ "spec/spec_helper.rb"
32
+ ]
33
+ s.homepage = %q{http://github.com/railsmachine/capistrano-cowboy}
34
+ s.require_paths = ["lib"]
35
+ s.rubygems_version = %q{1.3.7}
36
+ s.summary = %q{Deploy like a cowboy}
37
+ s.test_files = [
38
+ "spec/capistrano-cowboy_spec.rb",
39
+ "spec/spec_helper.rb"
40
+ ]
41
+
42
+ if s.respond_to? :specification_version then
43
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
44
+ s.specification_version = 3
45
+
46
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
47
+ s.add_runtime_dependency(%q<capistrano>, [">= 0"])
48
+ s.add_development_dependency(%q<rspec>, ["~> 2.0.0"])
49
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
50
+ s.add_development_dependency(%q<jeweler>, ["~> 1.5.0.pre5"])
51
+ s.add_development_dependency(%q<rcov>, [">= 0"])
52
+ else
53
+ s.add_dependency(%q<capistrano>, [">= 0"])
54
+ s.add_dependency(%q<rspec>, ["~> 2.0.0"])
55
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
56
+ s.add_dependency(%q<jeweler>, ["~> 1.5.0.pre5"])
57
+ s.add_dependency(%q<rcov>, [">= 0"])
58
+ end
59
+ else
60
+ s.add_dependency(%q<capistrano>, [">= 0"])
61
+ s.add_dependency(%q<rspec>, ["~> 2.0.0"])
62
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
63
+ s.add_dependency(%q<jeweler>, ["~> 1.5.0.pre5"])
64
+ s.add_dependency(%q<rcov>, [">= 0"])
65
+ end
66
+ end
67
+
@@ -0,0 +1 @@
1
+ require 'capistrano/cowboy'
@@ -0,0 +1,29 @@
1
+ require 'capistrano'
2
+
3
+ module Capistrano
4
+ class Cowboy
5
+ def self.load_into(configuration)
6
+ configuration.load do
7
+ namespace :cowboy do
8
+ task :configure do
9
+ deploy_stage = fetch(:stage, 'none')
10
+ set :repository, "."
11
+ set :deploy_via, :copy
12
+ set :scm, :none
13
+ set :stage, deploy_stage
14
+ set :cowboy_deploy, true
15
+ set :copy_exclude, [".git/*", ".svn/*", "log/*", "vendor/bundle/*"]
16
+ end
17
+ desc 'Deploy without SCM'
18
+ task :default do
19
+ before 'deploy:update_code', 'cowboy:configure'
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+
27
+ if Capistrano::Configuration.instance
28
+ Capistrano::Cowboy.load_into(Capistrano::Configuration.instance)
29
+ end
@@ -0,0 +1,7 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "CapistranoCowboy" do
4
+ it "fails" do
5
+ fail "hey buddy, you should probably rename this file and start specing for real"
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ require 'capistrano-cowboy'
2
+ require 'rspec'
3
+
4
+ # Requires supporting files with custom matchers and macros, etc,
5
+ # in ./support/ and its subdirectories.
6
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
7
+
8
+ RSpec.configure do |config|
9
+
10
+ end
metadata ADDED
@@ -0,0 +1,156 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-cowboy
3
+ version: !ruby/object:Gem::Version
4
+ hash: 25
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 1
10
+ version: 0.1.1
11
+ platform: ruby
12
+ authors:
13
+ - Jesse Newland
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-12-01 00:00:00 -05:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ name: capistrano
34
+ requirement: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ type: :development
37
+ prerelease: false
38
+ version_requirements: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ hash: 15
44
+ segments:
45
+ - 2
46
+ - 0
47
+ - 0
48
+ version: 2.0.0
49
+ name: rspec
50
+ requirement: *id002
51
+ - !ruby/object:Gem::Dependency
52
+ type: :development
53
+ prerelease: false
54
+ version_requirements: &id003 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ~>
58
+ - !ruby/object:Gem::Version
59
+ hash: 23
60
+ segments:
61
+ - 1
62
+ - 0
63
+ - 0
64
+ version: 1.0.0
65
+ name: bundler
66
+ requirement: *id003
67
+ - !ruby/object:Gem::Dependency
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: &id004 !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ hash: -1876988220
76
+ segments:
77
+ - 1
78
+ - 5
79
+ - 0
80
+ - pre5
81
+ version: 1.5.0.pre5
82
+ name: jeweler
83
+ requirement: *id004
84
+ - !ruby/object:Gem::Dependency
85
+ type: :development
86
+ prerelease: false
87
+ version_requirements: &id005 !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ hash: 3
93
+ segments:
94
+ - 0
95
+ version: "0"
96
+ name: rcov
97
+ requirement: *id005
98
+ description: capistrano-cowboy let's you deploy without having to commit to version control. While dangerous, this can be incredibly useful for testing the ops-related parts of a deploy
99
+ email: jesse@railsmachine.com
100
+ executables: []
101
+
102
+ extensions: []
103
+
104
+ extra_rdoc_files:
105
+ - LICENSE.txt
106
+ - README.rdoc
107
+ files:
108
+ - .document
109
+ - .rspec
110
+ - Gemfile
111
+ - Gemfile.lock
112
+ - LICENSE.txt
113
+ - README.rdoc
114
+ - Rakefile
115
+ - capistrano-cowboy.gemspec
116
+ - lib/capistrano-cowboy.rb
117
+ - lib/capistrano/cowboy.rb
118
+ - spec/capistrano-cowboy_spec.rb
119
+ - spec/spec_helper.rb
120
+ has_rdoc: true
121
+ homepage: http://github.com/railsmachine/capistrano-cowboy
122
+ licenses: []
123
+
124
+ post_install_message:
125
+ rdoc_options: []
126
+
127
+ require_paths:
128
+ - lib
129
+ required_ruby_version: !ruby/object:Gem::Requirement
130
+ none: false
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ hash: 3
135
+ segments:
136
+ - 0
137
+ version: "0"
138
+ required_rubygems_version: !ruby/object:Gem::Requirement
139
+ none: false
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ hash: 3
144
+ segments:
145
+ - 0
146
+ version: "0"
147
+ requirements: []
148
+
149
+ rubyforge_project:
150
+ rubygems_version: 1.3.7
151
+ signing_key:
152
+ specification_version: 3
153
+ summary: Deploy like a cowboy
154
+ test_files:
155
+ - spec/capistrano-cowboy_spec.rb
156
+ - spec/spec_helper.rb