All Projects → thoughtbot → Parity

thoughtbot / Parity

Licence: mit
Shell commands for development, staging, and production parity for Heroku apps

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Parity

Graphqldesigner.com
A developer web-app tool to rapidly prototype a full stack implementation of GraphQL with React.
Stars: ✭ 587 (-26.72%)
Mutual labels:  developer-tools
Powerline Shell
A beautiful and useful prompt for your shell
Stars: ✭ 5,743 (+616.98%)
Mutual labels:  developer-tools
Bloop
Bloop is a build server and CLI tool to compile, test and run Scala fast from any editor or build tool.
Stars: ✭ 730 (-8.86%)
Mutual labels:  developer-tools
Codeface
Typefaces for source code beautification
Stars: ✭ 5,612 (+600.62%)
Mutual labels:  developer-tools
Hostctl
Your dev tool to manage /etc/hosts like a pro!
Stars: ✭ 642 (-19.85%)
Mutual labels:  developer-tools
Devdocs
API Documentation Browser
Stars: ✭ 27,208 (+3296.75%)
Mutual labels:  developer-tools
React Cdk
under development - React Component Development Kit with Storybook
Stars: ✭ 583 (-27.22%)
Mutual labels:  developer-tools
Awesome Ios Interview
📲 The curated list of iOS Developer interview questions and answers, Swift & Objective-C
Stars: ✭ 753 (-5.99%)
Mutual labels:  developer-tools
Derive more
Some more derive(Trait) options
Stars: ✭ 647 (-19.23%)
Mutual labels:  developer-tools
Tddd
A Laravel Continuous Integration Package
Stars: ✭ 722 (-9.86%)
Mutual labels:  developer-tools
Lunar Unity Console
High-performance Unity iOS/Android logger built with native platform UI
Stars: ✭ 628 (-21.6%)
Mutual labels:  developer-tools
Apicurio Studio
Open Source API Design
Stars: ✭ 638 (-20.35%)
Mutual labels:  developer-tools
Puppeteer Api Zh cn
📖 Puppeteer中文文档(官方指定的中文文档)
Stars: ✭ 697 (-12.98%)
Mutual labels:  developer-tools
Wsta
A CLI development tool for WebSocket APIs
Stars: ✭ 611 (-23.72%)
Mutual labels:  developer-tools
Reactprimer
React component prototyping tool that generates fully connected class component code.
Stars: ✭ 743 (-7.24%)
Mutual labels:  developer-tools
Ram
⚛️ React Application Manager: create and run React (and other) applications – no command line or build setup required
Stars: ✭ 585 (-26.97%)
Mutual labels:  developer-tools
Faker
Faker is a pure Elixir library for generating fake data.
Stars: ✭ 673 (-15.98%)
Mutual labels:  developer-tools
Headcrab
A modern Rust debugging library 🦀
Stars: ✭ 756 (-5.62%)
Mutual labels:  developer-tools
Conferences.digital
👨‍💻Watch the latest and greatest conference videos on your Mac
Stars: ✭ 751 (-6.24%)
Mutual labels:  developer-tools
Revise.jl
Automatically update function definitions in a running Julia session
Stars: ✭ 705 (-11.99%)
Mutual labels:  developer-tools

Parity

Reviewed by Hound

Shell commands for development, staging, and production parity for Heroku apps.

Install

On macOS, this installs everything you need:

brew tap thoughtbot/formulae
brew install parity

On Debian:

wget -qO - https://apt.thoughtbot.com/thoughtbot.gpg.key | sudo apt-key add -
echo "deb http://apt.thoughtbot.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/thoughtbot.list
sudo apt-get update
sudo apt-get install parity

On other systems you can:

  1. Download the package for your system from the releases page
  2. Extract the tarball and place it so that /bin is in your PATH

Parity requires these command-line programs:

git
heroku
pg_restore

On macOS, these programs are installed as Homebrew package dependencies of the parity Homebrew package.

Usage

Backup a database:

production backup
staging backup

Restore a production or staging database backup into development:

development restore production
development restore staging

Or, if restore-from reads better to you, it's the same thing:

development restore-from production
development restore-from staging
  • Note that the restore command will use the most recent backup (from staging or production). You may first need to create a more recent backup before restoring, to prevent download of a very old backup.

Push your local development database backup up to staging:

staging restore development

Deploy main to production (note that prior versions of Parity would run database migrations, that's now better handled using Heroku release phase):

production deploy

Deploy the current branch to staging:

staging deploy

Note that deploys to non-production environments use git push --force.

Open a console:

production console
staging console
pr_app 1234 console

Migrate a database and restart the dynos:

production migrate
staging migrate
pr_app 1234 migrate

Tail a log:

production tail
staging tail
pr_app 1234 tail

Use redis-cli with your REDIS_URL add-on:

production redis-cli
staging redis-cli
pr_app 1234 redis-cli

The scripts also pass through, so you can do anything with them that you can do with heroku ______ --remote staging or heroku ______ --remote production:

watch production ps
staging open

You can optionally parallelize a DB restore by passing --parallelize as a flag to the development or production commands:

    development restore-from production --parallelize

Convention

Parity expects:

  • A staging remote pointing to the staging Heroku app.
  • A production remote pointing to the production Heroku app.
heroku git:remote -r staging -a your-staging-app
heroku git:remote -r production -a your-production-app
  • There is a config/database.yml file that can be parsed as YAML for ['development']['database'].

Pipelines

If you deploy review applications with Heroku pipelines, run commands against those applications with the pr_app command, followed by the PR number for your application:

pr_app 1234 console

This command assumes that your review applications have a name derived from the name of the application your staging Git remote points at.

Customization

If you have Heroku environments beyond staging and production (such as a feature environment for each developer), you can add a binstub to the bin folder of your application. Custom environments share behavior with staging: they can be backed up and can restore from production.

Using feature environments requires including Parity as a gem in your application's Gemfile.

gem "parity"

Here's an example binstub for a 'feature-geoff' environment, hosted at myapp-feature-geoff.herokuapp.com.

#!/usr/bin/env ruby

require "parity"

if ARGV.empty?
  puts Parity::Usage.new
else
  Parity::Environment.new("feature-geoff", ARGV).run
end

Issues

Please fill out our issues template if you are having problems.

Contributing

Please see CONTRIBUTING.md for details.

Version History

Please see the releases page for the version history, along with a description of the changes in each release.

Releasing

See guidelines in RELEASING.md for details

License

Parity is © 2013-2018 thoughtbot, inc. It is free software, and may be redistributed under the terms specified in the LICENSE file.

About thoughtbot

thoughtbot

Parity is maintained and funded by thoughtbot, inc. The names and logos for thoughtbot are trademarks of thoughtbot, inc.

We are passionate about open source software. See our other projects. We are available for hire.

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