{"id":13463306,"url":"https://github.com/mattpolito/paratrooper","last_synced_at":"2025-04-06T06:09:44.532Z","repository":{"id":6455557,"uuid":"7695241","full_name":"mattpolito/paratrooper","owner":"mattpolito","description":"Library for creating tasks that deploy to Heroku","archived":false,"fork":false,"pushed_at":"2020-06-26T07:10:39.000Z","size":211,"stargazers_count":107,"open_issues_count":9,"forks_count":19,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-30T05:05:57.237Z","etag":null,"topics":["deployment","heroku","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattpolito.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-18T21:58:10.000Z","updated_at":"2025-01-25T02:30:44.000Z","dependencies_parsed_at":"2022-09-07T18:00:38.246Z","dependency_job_id":null,"html_url":"https://github.com/mattpolito/paratrooper","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattpolito%2Fparatrooper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattpolito%2Fparatrooper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattpolito%2Fparatrooper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattpolito%2Fparatrooper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattpolito","download_url":"https://codeload.github.com/mattpolito/paratrooper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441053,"owners_count":20939239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deployment","heroku","ruby"],"created_at":"2024-07-31T13:00:50.348Z","updated_at":"2025-04-06T06:09:44.509Z","avatar_url":"https://github.com/mattpolito.png","language":"Ruby","funding_links":[],"categories":["Provision, Deploy \u0026 Host"],"sub_categories":["Deployment Automation"],"readme":"![Paratrooper](http://f.cl.ly/items/0Z1v1P1l1B1h1k1l2q0E/paratrooper_header.png)\n\n[![Gem Version](http://img.shields.io/gem/v/paratrooper.svg?style=flat)](http://badge.fury.io/rb/paratrooper)\n[![Build Status](http://img.shields.io/travis/mattpolito/paratrooper/master.svg?style=flat)](https://travis-ci.org/mattpolito/paratrooper)\n[![Code Climate](http://img.shields.io/codeclimate/github/mattpolito/paratrooper.svg?style=flat)](https://codeclimate.com/github/mattpolito/paratrooper)\n\nSimplify your [Heroku][] deploy with quick and concise deployment rake tasks.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```shell\ngem 'paratrooper'\n```\n\nand then execute\n\n```shell\nbundle\n```\n\nor\n\ninstall it yourself with\n\n```shell\ngem install paratrooper\n```\n\n## Usage\n\nInstantiate Paratrooper with the name of your heroku application.\n\n```ruby\nParatrooper.deploy('amazing-app')\n```\n\nYou can also provide a tag:\n\n```ruby\nParatrooper.deploy('amazing-app') do |config|\n  config.tag = 'staging'\nend\n```\n\n## Authentication\n\nYou can authenticate your Heroku account in a few ways:\n\n* Provide an API Key\n\n```ruby\nParatrooper.deploy('app') do |config|\n  config.api_key = 'API_KEY'\nend\n```\n\n* Set an environment variable\n\n```ruby\nENV['HEROKU_API_KEY'] = 'API_KEY'\nParatrooper.deploy('app')\n```\n\n* Local Netrc file\n\n```ruby\nParatrooper.deploy('app')\n```\n\nThis method works via a local Netrc file handled via the [Heroku Toolbelt][] and is the default and preferred method for providing authentication keys.\n\n## Git SSH key configuration\n\nIf you use multiple SSH keys for managing multiple accounts, for example in your `.ssh/config`, you can set the `deployment_host` option:\n\n```ruby\nParatrooper.deploy('amazing-app') do |config|\n  config.deployment_host = 'HOST'\nend\n```\n\nThis also works if you're using the [heroku-accounts](https://github.com/ddollar/heroku-accounts) plugin:\n\n```ruby\nParatrooper.deploy('app') do |config|\n  config.deployment_host: 'heroku.ACCOUNT_NAME'\nend\n```\n\n## Tag Management\n\nPlease note: Tag management has been removed from Paratrooper 3. It added unneccesary complexity around an individual's deployment process.\n\n## Sensible Default Deployment\n\nYou can use the object's methods any way you'd like, but we've provided a sensible default at `Paratrooper.deploy`.\n\nThis will perform the following tasks:\n\n* Push changes to Heroku\n* Run database migrations if any have been added to db/migrate\n* Restart the application if migrations needed to be run\n\n### Example Usage\n\n```ruby\nnamespace :deploy do\n  desc 'Deploy app in staging environment'\n  task :staging do\n    Paratrooper.deploy(\"amazing-staging-app\")\n  end\n\n  desc 'Deploy app in production environment'\n  task :production do\n    Paratrooper.deploy(\"amazing-production-app\")\n  end\nend\n```\n\n## Bucking the Norm\n\nOur default deploy gets us most of the way, but maybe it's not for you--we've\ngot you covered. Every deployment method has a set of callback instructions that can be\nutilized in almost any way you can imagine.\n\nThe `add_callback` method allows for the execution of arbitrary code within different steps of the deploy process.\n\nThere are 'before' and 'after' hooks for each of the following:\n\n* setup\n* activate_maintenance_mode\n* push_repo\n* run_migrations\n* app_restart\n* deactivate_maintenance_mode\n* warm_instance\n* teardown\n\n### Example Usage\n\nFor example, say you want to let [New Relic][] know that you are deploying and\nto disable your application monitoring.\n\n```ruby\n# lib/tasks/deploy.rake\n\nnamespace :deploy do\n  desc 'Deploy app in production environment'\n  task :production do\n    Paratrooper.deploy(\"amazing-production-app\") do |config|\n      config.add_callback(:before_setup) do |output|\n        output.display(\"Totally going to turn off newrelic\")\n        system %Q[curl https://rpm.newrelic.com/accounts/ACCOUNT_ID/applications/APPLICATION_ID/ping_targets/disable -X POST -H \"X-Api-Key: API_KEY\"]\n      end\n\n      config.add_callback(:after_teardown) do |output|\n        system %Q[curl https://rpm.newrelic.com/accounts/ACCOUNT_ID/applications/APPLICATION_ID/ping_targets/enable -X POST -H \"X-Api-Key: API_KEY\"]\n        output.display(\"Aaaannnd we're back\")\n      end\n    end\n  end\nend\n```\n\nOr maybe you just want to run a rake task on your application. Since this task may take a moment to complete it's probably a good idea to throw up a maintenance page.\n\n```ruby\n# lib/tasks/deploy.rake\n\nnamespace :deploy do\n  desc 'Deploy app in production environment'\n  task :production do\n    Paratrooper.deploy(\"amazing-production-app\") do |config|\n      config.maintenance = true\n      config.add_callback(:after_teardown) do |output|\n        output.display(\"Running some task that needs to run\")\n        config.add_remote_task(\"rake some:task:to:run\")\n      end\n    end\n  end\nend\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`).\n3. Commit your changes (`git commit -am 'Add some feature'`).\n4. Push to the branch (`git push origin my-new-feature`).\n5. Create new Pull Request.\n\n## Thanks\n\n* [Rye Mason][] for the fantastic heading image.\n\n[Heroku]: http://heroku.com\n[Heroku Toolbelt]: http://toolbelt.heroku.com\n[New Relic]: http://newrelic.com\n[Rye Mason]: https://github.com/ryenotbread\n[`Paratrooper::Notifier`]: https://github.com/mattpolito/paratrooper/blob/master/lib/paratrooper/notifier.rb\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattpolito%2Fparatrooper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattpolito%2Fparatrooper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattpolito%2Fparatrooper/lists"}