README.md in paratrooper-2.0.0 vs README.md in paratrooper-2.1.0
- old
+ new
@@ -101,13 +101,11 @@
By providing tag options for Paratrooper, your code can be tagged and deployed from various reference points.
### Staging example
```ruby
- Paratrooper::Deploy.new("staging-app",
- tag: 'staging'
- )
+ Paratrooper::Deploy.new("staging-app", tag: 'staging')
```
This will create/update a `staging` git tag at `HEAD`.
### Production example
```ruby
@@ -147,24 +145,22 @@
require 'paratrooper'
namespace :deploy do
desc 'Deploy app in staging environment'
task :staging do
- deployment = Paratrooper::Deploy.new("amazing-staging-app",
- tag: 'staging'
- )
+ deployment = Paratrooper::Deploy.new("amazing-staging-app", tag: 'staging')
deployment.deploy
end
desc 'Deploy app in production environment'
task :production do
deployment = Paratrooper::Deploy.new("amazing-production-app") do |deploy|
deploy.tag = 'production',
deploy.match_tag = 'staging',
deploy.maintenance_mode = !ENV['NO_MAINTENANCE']
- )
+ end
deployment.deploy
end
end
```
@@ -194,11 +190,10 @@
For example, say you want to let [New Relic][] know that you are deploying and
to disable your application monitoring.
```ruby
# lib/tasks/deploy.rake
-require 'paratrooper'
namespace :deploy do
desc 'Deploy app in production environment'
task :production do
deployment = Paratrooper::Deploy.new("amazing-production-app") do |deploy|
@@ -209,9 +204,29 @@
system %Q[curl https://rpm.newrelic.com/accounts/ACCOUNT_ID/applications/APPLICATION_ID/ping_targets/disable -X POST -H "X-Api-Key: API_KEY"]
end
deploy.add_callback(:after_teardown) do |output|
system %Q[curl https://rpm.newrelic.com/accounts/ACCOUNT_ID/applications/APPLICATION_ID/ping_targets/enable -X POST -H "X-Api-Key: API_KEY"]
output.display("Aaaannnd we're back")
+ end
+ end
+
+ deployment.deploy
+ end
+end
+```
+
+Or maybe you just want to run a rake task on your application
+
+```ruby
+# lib/tasks/deploy.rake
+
+namespace :deploy do
+ desc 'Deploy app in production environment'
+ task :production do
+ deployment = Paratrooper::Deploy.new("amazing-production-app") do |deploy|
+ deploy.add_callback(:after_teardown) do |output|
+ output.display("Running some task that needs to run")
+ deploy.add_remote_task("rake some:task:to:run")
end
end
deployment.deploy
end