heroku_san 3.0.1 → 3.0.2
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/CHANGELOG.md +4 -0
- data/heroku_san.gemspec +1 -0
- data/lib/heroku_san/tasks.rb +20 -11
- data/lib/heroku_san/version.rb +1 -1
- data/spec/heroku_san/stage_spec.rb +5 -5
- metadata +16 -3
data/CHANGELOG.md
CHANGED
data/heroku_san.gemspec
CHANGED
@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.add_development_dependency(%q<cucumber>)
|
32
32
|
s.add_development_dependency(%q<rake>)
|
33
33
|
s.add_development_dependency(%q<bundler>, ['~> 1.1 '])
|
34
|
+
s.add_development_dependency('git-smart')
|
34
35
|
else
|
35
36
|
s.add_dependency(%q<rails>, ['>= 2'])
|
36
37
|
s.add_dependency(%q<heroku>, ['>= 2'])
|
data/lib/heroku_san/tasks.rb
CHANGED
@@ -22,7 +22,7 @@ namespace :heroku do
|
|
22
22
|
task 'stage:all' do
|
23
23
|
HerokuSan.project << HerokuSan.project.all
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
desc "Creates the Heroku app"
|
27
27
|
task :create do
|
28
28
|
each_heroku_app do |stage|
|
@@ -88,7 +88,9 @@ namespace :heroku do
|
|
88
88
|
desc 'Add config:vars to each application.'
|
89
89
|
task :config do
|
90
90
|
each_heroku_app do |stage|
|
91
|
-
|
91
|
+
stage.push_config.each do |(key,value)|
|
92
|
+
puts "#{key}: #{value}"
|
93
|
+
end
|
92
94
|
end
|
93
95
|
end
|
94
96
|
|
@@ -96,7 +98,10 @@ namespace :heroku do
|
|
96
98
|
task :addons do
|
97
99
|
each_heroku_app do |stage|
|
98
100
|
addons = stage.install_addons
|
99
|
-
puts
|
101
|
+
puts "#{stage.name} addons"
|
102
|
+
addons.each do |addon|
|
103
|
+
puts " - " + addon['name'] + (addon['configured'] ? "" : " # Configure at https://api.heroku.com/myapps/#{stage.app}/addons/#{addon['name']}")
|
104
|
+
end
|
100
105
|
end
|
101
106
|
end
|
102
107
|
|
@@ -145,7 +150,9 @@ namespace :heroku do
|
|
145
150
|
task :list do
|
146
151
|
each_heroku_app do |stage|
|
147
152
|
puts "#{stage.name}:"
|
148
|
-
|
153
|
+
stage.long_config.each do |(key,value)|
|
154
|
+
puts "#{key}: #{value}"
|
155
|
+
end
|
149
156
|
end
|
150
157
|
end
|
151
158
|
|
@@ -154,12 +161,14 @@ namespace :heroku do
|
|
154
161
|
task :local do
|
155
162
|
each_heroku_app do |stage|
|
156
163
|
puts "#{stage.name}:"
|
157
|
-
|
164
|
+
stage.config.each do |(key,value)|
|
165
|
+
puts "#{key}: #{value}"
|
166
|
+
end
|
158
167
|
end
|
159
168
|
end
|
160
169
|
end
|
161
170
|
end
|
162
|
-
|
171
|
+
|
163
172
|
desc 'Runs a rake task remotely'
|
164
173
|
task :rake, [:task] do |t, args|
|
165
174
|
each_heroku_app do |stage|
|
@@ -287,11 +296,11 @@ namespace :heroku do
|
|
287
296
|
desc "Pull database from stage to local dev database"
|
288
297
|
task :pull do
|
289
298
|
each_heroku_app do |stage|
|
290
|
-
sh "heroku
|
291
|
-
dump = `heroku
|
299
|
+
sh "heroku pgbackups:capture --expire --app #{stage.app}"
|
300
|
+
dump = `heroku pgbackups --app #{stage.app}`.split("\n").last.split(" ").first
|
292
301
|
sh "mkdir -p #{Rails.root}/db/dumps"
|
293
302
|
file = "#{Rails.root}/db/dumps/#{dump}.sql.gz"
|
294
|
-
url = `heroku
|
303
|
+
url = `heroku pgbackups:url --app #{stage.app} #{dump}`.chomp
|
295
304
|
sh "wget", url, "-O", file
|
296
305
|
sh "rake db:drop db:create"
|
297
306
|
sh "gunzip -c #{file} | #{Rails.root}/script/dbconsole"
|
@@ -299,7 +308,7 @@ namespace :heroku do
|
|
299
308
|
end
|
300
309
|
end
|
301
310
|
end
|
302
|
-
|
311
|
+
|
303
312
|
desc "Run a bash shell on Heroku"
|
304
313
|
task :shell do
|
305
314
|
each_heroku_app do |stage|
|
@@ -342,4 +351,4 @@ rescue HerokuSan::NoApps => e
|
|
342
351
|
rake all heroku:share"
|
343
352
|
|
344
353
|
exit(1)
|
345
|
-
end
|
354
|
+
end
|
data/lib/heroku_san/version.rb
CHANGED
@@ -268,24 +268,24 @@ describe HerokuSan::Stage do
|
|
268
268
|
describe "#installed_addons" do
|
269
269
|
it "returns the list of installed addons" do
|
270
270
|
with_app(subject, 'name' => subject.app) do |app_data|
|
271
|
-
subject.installed_addons.map{|a|a['name']}.should
|
271
|
+
subject.installed_addons.map{|a|a['name']}.should include *%w[shared-database:5mb]
|
272
272
|
end
|
273
273
|
end
|
274
274
|
end
|
275
275
|
|
276
276
|
describe '#install_addons' do
|
277
|
-
subject { HerokuSan::Stage.new('production', {"app" => "awesomeapp", "stack" => "bamboo-ree-1.8.7", "addons" => [
|
277
|
+
subject { HerokuSan::Stage.new('production', {"app" => "awesomeapp", "stack" => "bamboo-ree-1.8.7", "addons" => %w[custom_domains:basic ssl:piggyback]})}
|
278
278
|
|
279
279
|
it "installs the addons" do
|
280
280
|
with_app(subject, 'name' => subject.app) do |app_data|
|
281
|
-
subject.install_addons.map{|a| a['name']}.should
|
281
|
+
subject.install_addons.map{|a| a['name']}.should include *%w[custom_domains:basic ssl:piggyback]
|
282
282
|
subject.installed_addons.map{|a|a['name']}.should =~ subject.install_addons.map{|a| a['name']}
|
283
283
|
end
|
284
284
|
end
|
285
285
|
it "only installs missing addons" do
|
286
|
-
subject = HerokuSan::Stage.new('production', {"app" => "awesomeapp", "stack" => "bamboo-ree-1.8.7", "addons" => [
|
286
|
+
subject = HerokuSan::Stage.new('production', {"app" => "awesomeapp", "stack" => "bamboo-ree-1.8.7", "addons" => %w[shared-database:5mb custom_domains:basic ssl:piggyback]})
|
287
287
|
with_app(subject, 'name' => subject.app) do |app_data|
|
288
|
-
subject.install_addons.map{|a| a['name']}.should
|
288
|
+
subject.install_addons.map{|a| a['name']}.should include *%w[shared-database:5mb custom_domains:basic ssl:piggyback]
|
289
289
|
end
|
290
290
|
end
|
291
291
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 3
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 3.0.
|
8
|
+
- 2
|
9
|
+
version: 3.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Elijah Miller
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2012-
|
20
|
+
date: 2012-06-04 00:00:00 -07:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
@@ -140,6 +140,19 @@ dependencies:
|
|
140
140
|
version: "1.1"
|
141
141
|
type: :development
|
142
142
|
version_requirements: *id009
|
143
|
+
- !ruby/object:Gem::Dependency
|
144
|
+
name: git-smart
|
145
|
+
prerelease: false
|
146
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
147
|
+
none: false
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
segments:
|
152
|
+
- 0
|
153
|
+
version: "0"
|
154
|
+
type: :development
|
155
|
+
version_requirements: *id010
|
143
156
|
description: Manage multiple Heroku instances/apps for a single Rails app using Rake
|
144
157
|
email: elijah.miller@gmail.com
|
145
158
|
executables: []
|