heroku_san_sanity 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/LICENSE +20 -0
- data/README.md +26 -0
- data/Rakefile +2 -0
- data/heroku_san_sanity.gemspec +25 -0
- data/lib/heroku_san_sanity/railtie.rb +9 -0
- data/lib/heroku_san_sanity/tasks.rb +27 -0
- data/lib/heroku_san_sanity/version.rb +3 -0
- data/lib/heroku_san_sanity.rb +1 -0
- metadata +124 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 Neil Middleton
|
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.md
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
heroku_san_sanity
|
2
|
+
============
|
3
|
+
|
4
|
+
heroku_san_sanity is a sibling task to the heroku_san gem
|
5
|
+
|
6
|
+
If you are deploying with Heroku_san, Heroku_san_sanity will sense check all production deploys with an 'Are you sure?' message
|
7
|
+
|
8
|
+
Installation
|
9
|
+
------------
|
10
|
+
|
11
|
+
Add the following to your Gemfile:
|
12
|
+
|
13
|
+
group :development do
|
14
|
+
gem 'herok_san_sanity'
|
15
|
+
end
|
16
|
+
|
17
|
+
This gem must only be used in applications that use Heroku.
|
18
|
+
|
19
|
+
Note on Patches/Pull Requests
|
20
|
+
-----------------------------
|
21
|
+
|
22
|
+
* Fork the project.
|
23
|
+
* Make your feature addition or bug fix.
|
24
|
+
* Add tests for it. This is important so I don’t break it in a future version unintentionally.
|
25
|
+
* Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
26
|
+
* Send me a pull request. Bonus points for topic branches.
|
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "heroku_san_sanity/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "heroku_san_sanity"
|
7
|
+
s.version = HerokuSanSanity::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Neil Middleton"]
|
10
|
+
s.email = ["neil.middleton@gmail.com"]
|
11
|
+
s.homepage = ""
|
12
|
+
s.summary = %q{Sanity check deploys with heroku_san}
|
13
|
+
s.description = %q{Adds a sanity check 'Are you sure?' before deploying to any environment named 'production'}
|
14
|
+
|
15
|
+
s.rubyforge_project = "heroku_san_sanity"
|
16
|
+
|
17
|
+
s.add_dependency "heroku", ">= 1.17.10"
|
18
|
+
s.add_dependency "heroku_san", ">= 1.0.0"
|
19
|
+
s.add_dependency "highline", ">= 1.6.1"
|
20
|
+
|
21
|
+
s.files = `git ls-files`.split("\n")
|
22
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
23
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
24
|
+
s.require_paths = ["lib"]
|
25
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require "highline/import"
|
2
|
+
|
3
|
+
@exec = false
|
4
|
+
|
5
|
+
def check_answer(answer, name)
|
6
|
+
@exec = true
|
7
|
+
if answer.downcase != name
|
8
|
+
raise " ! Input did not match #{name}. Aborted."
|
9
|
+
false
|
10
|
+
end
|
11
|
+
true
|
12
|
+
end
|
13
|
+
|
14
|
+
desc 'Force sanity check on production deploys'
|
15
|
+
task :before_deploy => :environment do |name, t, args|
|
16
|
+
each_heroku_app do |name, app, repo|
|
17
|
+
if name == 'production' && @exec == false
|
18
|
+
puts ""
|
19
|
+
puts " ! WARNING: Potentially Destructive Action"
|
20
|
+
puts " ! This command will affect the environment: #{name}"
|
21
|
+
puts " ! To proceed, type \"#{name}\""
|
22
|
+
puts ""
|
23
|
+
answer = ask("> ", String)
|
24
|
+
check_answer(answer, name)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'heroku_san_sanity/railtie' if defined?(Rails)
|
metadata
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: heroku_san_sanity
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Neil Middleton
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-03-07 00:00:00 +00:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: heroku
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 71
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 17
|
33
|
+
- 10
|
34
|
+
version: 1.17.10
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: heroku_san
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 23
|
46
|
+
segments:
|
47
|
+
- 1
|
48
|
+
- 0
|
49
|
+
- 0
|
50
|
+
version: 1.0.0
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: highline
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 13
|
62
|
+
segments:
|
63
|
+
- 1
|
64
|
+
- 6
|
65
|
+
- 1
|
66
|
+
version: 1.6.1
|
67
|
+
type: :runtime
|
68
|
+
version_requirements: *id003
|
69
|
+
description: Adds a sanity check 'Are you sure?' before deploying to any environment named 'production'
|
70
|
+
email:
|
71
|
+
- neil.middleton@gmail.com
|
72
|
+
executables: []
|
73
|
+
|
74
|
+
extensions: []
|
75
|
+
|
76
|
+
extra_rdoc_files: []
|
77
|
+
|
78
|
+
files:
|
79
|
+
- .gitignore
|
80
|
+
- Gemfile
|
81
|
+
- LICENSE
|
82
|
+
- README.md
|
83
|
+
- Rakefile
|
84
|
+
- heroku_san_sanity.gemspec
|
85
|
+
- lib/heroku_san_sanity.rb
|
86
|
+
- lib/heroku_san_sanity/railtie.rb
|
87
|
+
- lib/heroku_san_sanity/tasks.rb
|
88
|
+
- lib/heroku_san_sanity/version.rb
|
89
|
+
has_rdoc: true
|
90
|
+
homepage: ""
|
91
|
+
licenses: []
|
92
|
+
|
93
|
+
post_install_message:
|
94
|
+
rdoc_options: []
|
95
|
+
|
96
|
+
require_paths:
|
97
|
+
- lib
|
98
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
hash: 3
|
104
|
+
segments:
|
105
|
+
- 0
|
106
|
+
version: "0"
|
107
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
hash: 3
|
113
|
+
segments:
|
114
|
+
- 0
|
115
|
+
version: "0"
|
116
|
+
requirements: []
|
117
|
+
|
118
|
+
rubyforge_project: heroku_san_sanity
|
119
|
+
rubygems_version: 1.4.2
|
120
|
+
signing_key:
|
121
|
+
specification_version: 3
|
122
|
+
summary: Sanity check deploys with heroku_san
|
123
|
+
test_files: []
|
124
|
+
|