All Projects β†’ mattpolito β†’ Paratrooper

mattpolito / Paratrooper

Licence: mit
Library for creating tasks that deploy to Heroku

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Paratrooper

Caprover
Scalable PaaS (automated Docker+nginx) - aka Heroku on Steroids
Stars: ✭ 7,964 (+7140%)
Mutual labels:  heroku, deployment
Rocket
Automated software delivery as fast and easy as possible πŸš€
Stars: ✭ 217 (+97.27%)
Mutual labels:  heroku, deployment
Learn Devops
🚧 Learn the craft of "DevOps" (Developer Operations) to Deploy your App and Monitor it so it stays "Up"!
Stars: ✭ 139 (+26.36%)
Mutual labels:  heroku, deployment
phoenix example
An example Phoenix app with one-click deployments to different cloud services.
Stars: ✭ 62 (-43.64%)
Mutual labels:  heroku, deployment
Django-on-Docker-with-Heroku-and-OpenCV
Deploy Django on Docker to Heroku and include OpenCV
Stars: ✭ 24 (-78.18%)
Mutual labels:  heroku, deployment
GitHub-Education-Portfolio
A portfolio made using React and tools from GitHub Student Developer Pack
Stars: ✭ 50 (-54.55%)
Mutual labels:  heroku, deployment
buffalo-heroku
Archived use github.com/gobuffalo/buffalo-heroku
Stars: ✭ 16 (-85.45%)
Mutual labels:  heroku, deployment
Phoenix Chat Example
πŸ’¬ A Step-by-Step Beginners Tutorial for Building, Testing & Deploying a Chat app in Phoenix 1.5.5 πŸš€
Stars: ✭ 452 (+310.91%)
Mutual labels:  heroku, deployment
Up
Up focuses on deploying "vanilla" HTTP servers so there's nothing new to learn, just develop with your favorite existing frameworks such as Express, Koa, Django, Golang net/http or others.
Stars: ✭ 8,439 (+7571.82%)
Mutual labels:  heroku, deployment
Windowsagent
OCS Inventory NG Agent for Windows
Stars: ✭ 100 (-9.09%)
Mutual labels:  deployment
Qaror
Questions & Answers platform on Rails - stackoverflow clone
Stars: ✭ 107 (-2.73%)
Mutual labels:  heroku
Phploy
PHPloy - Incremental Git (S)FTP deployment tool that supports multiple servers, submodules and rollbacks.
Stars: ✭ 1,365 (+1140.91%)
Mutual labels:  deployment
Covid19 Dashboard
🦠 Django + Plotly Coronavirus dashboard. Powerful data driven Python web-app, with an awesome UI. Contributions welcomed! Featured on πŸ•ΆAwesome-list
Stars: ✭ 100 (-9.09%)
Mutual labels:  heroku
Github Pages Deploy Action
Automatically deploy your project to GitHub Pages using GitHub Actions. This action can be configured to push your production-ready code into any branch you'd like.
Stars: ✭ 2,507 (+2179.09%)
Mutual labels:  deployment
Koa Sslify
Enforce HTTPS in node.js koa apps
Stars: ✭ 100 (-9.09%)
Mutual labels:  heroku
Medical Appointment Scheduling
Concept showcase for "Appointment Scheduling System for Small and Medium-Sized Medical Facilities"
Stars: ✭ 109 (-0.91%)
Mutual labels:  heroku
Team Container
A collection of containers to prepare a server for collaboration.
Stars: ✭ 100 (-9.09%)
Mutual labels:  deployment
Nitro Demo
nuxt nitro preview
Stars: ✭ 100 (-9.09%)
Mutual labels:  deployment
Doctr
A tool for automatically deploying docs from Travis CI to GitHub pages.
Stars: ✭ 110 (+0%)
Mutual labels:  deployment
Rhcsa8env
This is a RHCSA8 study environment built with Vagrant/Ansible
Stars: ✭ 108 (-1.82%)
Mutual labels:  deployment

Paratrooper

Gem Version Build Status Code Climate

Simplify your Heroku deploy with quick and concise deployment rake tasks.

Installation

Add this line to your application's Gemfile:

gem 'paratrooper'

and then execute

bundle

or

install it yourself with

gem install paratrooper

Usage

Instantiate Paratrooper with the name of your heroku application.

Paratrooper.deploy('amazing-app')

You can also provide a tag:

Paratrooper.deploy('amazing-app') do |config|
  config.tag = 'staging'
end

Authentication

You can authenticate your Heroku account in a few ways:

  • Provide an API Key
Paratrooper.deploy('app') do |config|
  config.api_key = 'API_KEY'
end
  • Set an environment variable
ENV['HEROKU_API_KEY'] = 'API_KEY'
Paratrooper.deploy('app')
  • Local Netrc file
Paratrooper.deploy('app')

This method works via a local Netrc file handled via the Heroku Toolbelt and is the default and preferred method for providing authentication keys.

Git SSH key configuration

If you use multiple SSH keys for managing multiple accounts, for example in your .ssh/config, you can set the deployment_host option:

Paratrooper.deploy('amazing-app') do |config|
  config.deployment_host = 'HOST'
end

This also works if you're using the heroku-accounts plugin:

Paratrooper.deploy('app') do |config|
  config.deployment_host: 'heroku.ACCOUNT_NAME'
end

Tag Management

Please note: Tag management has been removed from Paratrooper 3. It added unneccesary complexity around an individual's deployment process.

Sensible Default Deployment

You can use the object's methods any way you'd like, but we've provided a sensible default at Paratrooper.deploy.

This will perform the following tasks:

  • Push changes to Heroku
  • Run database migrations if any have been added to db/migrate
  • Restart the application if migrations needed to be run

Example Usage

namespace :deploy do
  desc 'Deploy app in staging environment'
  task :staging do
    Paratrooper.deploy("amazing-staging-app")
  end

  desc 'Deploy app in production environment'
  task :production do
    Paratrooper.deploy("amazing-production-app")
  end
end

Bucking the Norm

Our default deploy gets us most of the way, but maybe it's not for you--we've got you covered. Every deployment method has a set of callback instructions that can be utilized in almost any way you can imagine.

The add_callback method allows for the execution of arbitrary code within different steps of the deploy process.

There are 'before' and 'after' hooks for each of the following:

  • setup
  • activate_maintenance_mode
  • push_repo
  • run_migrations
  • app_restart
  • deactivate_maintenance_mode
  • warm_instance
  • teardown

Example Usage

For example, say you want to let New Relic know that you are deploying and to disable your application monitoring.

# lib/tasks/deploy.rake

namespace :deploy do
  desc 'Deploy app in production environment'
  task :production do
    Paratrooper.deploy("amazing-production-app") do |config|
      config.add_callback(:before_setup) do |output|
        output.display("Totally going to turn off newrelic")
        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

      config.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
  end
end

Or 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.

# lib/tasks/deploy.rake

namespace :deploy do
  desc 'Deploy app in production environment'
  task :production do
    Paratrooper.deploy("amazing-production-app") do |config|
      config.maintenance = true
      config.add_callback(:after_teardown) do |output|
        output.display("Running some task that needs to run")
        config.add_remote_task("rake some:task:to:run")
      end
    end
  end
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am 'Add some feature').
  4. Push to the branch (git push origin my-new-feature).
  5. Create new Pull Request.

Thanks

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].