paratrooper 2.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +2 -3
- data/lib/paratrooper/deploy.rb +10 -4
- data/lib/paratrooper/pending_migration_check.rb +9 -3
- data/lib/paratrooper/version.rb +1 -1
- data/spec/paratrooper/pending_migration_check_spec.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af4cf12a15977e47b772161b7acb99494f710126
|
4
|
+
data.tar.gz: 01d567099249dafbbb418a3f6882265222ed1b03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c3a3302dbf94762959b00613c4ae66a58978460d40ebbff6cbac49907cd6dc20c81cb5e4af0a2f3f2c4c446c4d7250b99329e90ac67f77b5e9215754a94299f
|
7
|
+
data.tar.gz: 8d2a914587895cd37dedaaa5e7c4bf32e76aea5658d091f227839c5685891365c41f8074dca1fda214582a461953fce09b6b579498603ad7ddb60a1548257104
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -155,9 +155,8 @@ namespace :deploy do
|
|
155
155
|
desc 'Deploy app in production environment'
|
156
156
|
task :production do
|
157
157
|
deployment = Paratrooper::Deploy.new("amazing-production-app") do |deploy|
|
158
|
-
deploy.tag = 'production'
|
159
|
-
deploy.match_tag = 'staging'
|
160
|
-
deploy.maintenance_mode = !ENV['NO_MAINTENANCE']
|
158
|
+
deploy.tag = 'production'
|
159
|
+
deploy.match_tag = 'staging'
|
161
160
|
end
|
162
161
|
|
163
162
|
deployment.deploy
|
data/lib/paratrooper/deploy.rb
CHANGED
@@ -106,6 +106,12 @@ module Paratrooper
|
|
106
106
|
end
|
107
107
|
end
|
108
108
|
|
109
|
+
def maintenance_mode(&block)
|
110
|
+
activate_maintenance_mode
|
111
|
+
block.call if block_given?
|
112
|
+
deactivate_maintenance_mode
|
113
|
+
end
|
114
|
+
|
109
115
|
# Public: Creates a git tag and pushes it to repository.
|
110
116
|
#
|
111
117
|
def update_repo_tag
|
@@ -178,12 +184,12 @@ module Paratrooper
|
|
178
184
|
# Alias: #deploy
|
179
185
|
def default_deploy
|
180
186
|
setup
|
181
|
-
activate_maintenance_mode
|
182
187
|
update_repo_tag
|
183
188
|
push_repo
|
184
|
-
|
185
|
-
|
186
|
-
|
189
|
+
maintenance_mode do
|
190
|
+
run_migrations
|
191
|
+
app_restart
|
192
|
+
end
|
187
193
|
warm_instance
|
188
194
|
teardown
|
189
195
|
end
|
@@ -11,13 +11,19 @@ module Paratrooper
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def migrations_waiting?
|
14
|
-
|
15
|
-
self.diff = system_caller.execute(call)
|
16
|
-
!diff.strip.empty?
|
14
|
+
@migrations_waiting ||= check_for_pending_migrations
|
17
15
|
end
|
18
16
|
|
19
17
|
def last_deployed_commit
|
20
18
|
@last_deploy_commit ||= heroku.last_deploy_commit
|
21
19
|
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def check_for_pending_migrations
|
24
|
+
call = %Q[git diff --shortstat #{last_deployed_commit} #{match_tag_name} -- db/migrate]
|
25
|
+
self.diff = system_caller.execute(call)
|
26
|
+
!diff.strip.empty?
|
27
|
+
end
|
22
28
|
end
|
23
29
|
end
|
data/lib/paratrooper/version.rb
CHANGED
@@ -21,6 +21,11 @@ describe Paratrooper::PendingMigrationCheck do
|
|
21
21
|
migration_check.migrations_waiting?
|
22
22
|
end
|
23
23
|
|
24
|
+
it "memoizes the git diff" do
|
25
|
+
system_caller.should_receive(:execute).exactly(1).times.and_return("DIFF")
|
26
|
+
migration_check.migrations_waiting?
|
27
|
+
end
|
28
|
+
|
24
29
|
context "and migrations are in diff" do
|
25
30
|
it "returns true" do
|
26
31
|
expected_call = %Q[git diff --shortstat LAST_DEPLOYED_COMMIT MATCH -- db/migrate]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paratrooper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Polito
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|