{"id":13427836,"url":"https://github.com/thoughtbot/parity","last_synced_at":"2025-05-14T18:06:03.935Z","repository":{"id":8432650,"uuid":"10021706","full_name":"thoughtbot/parity","owner":"thoughtbot","description":"Shell commands for development, staging, and production parity for Heroku apps","archived":false,"fork":false,"pushed_at":"2024-09-03T23:10:51.000Z","size":191,"stargazers_count":893,"open_issues_count":12,"forks_count":57,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-10T09:54:12.199Z","etag":null,"topics":["developer-tools","heroku-apps","ruby","twelve-factor"],"latest_commit_sha":null,"homepage":"https://thoughtbot.com","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/thoughtbot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"thoughtbot"}},"created_at":"2013-05-13T00:30:12.000Z","updated_at":"2025-05-08T03:49:29.000Z","dependencies_parsed_at":"2024-12-12T18:00:50.955Z","dependency_job_id":"8cee7266-d521-4d96-ad51-ca3bd02a4fed","html_url":"https://github.com/thoughtbot/parity","commit_stats":{"total_commits":163,"total_committers":33,"mean_commits":"4.9393939393939394","dds":0.4785276073619632,"last_synced_commit":"f28ba68e3f155be0a584e5d2dd225dce4a28b7b9"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtbot%2Fparity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtbot%2Fparity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtbot%2Fparity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtbot%2Fparity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thoughtbot","download_url":"https://codeload.github.com/thoughtbot/parity/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254198514,"owners_count":22030965,"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":["developer-tools","heroku-apps","ruby","twelve-factor"],"created_at":"2024-07-31T01:00:41.049Z","updated_at":"2025-05-14T18:05:58.925Z","avatar_url":"https://github.com/thoughtbot.png","language":"Ruby","readme":"Parity\n======\n\n[![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)\n\nShell commands for development, staging, and production parity for Heroku apps.\n\nInstall\n-------\n\n    gem install parity\n\nOr bundle it in your project:\n\n    gem \"parity\"\n\n[releases]: https://github.com/thoughtbot/parity/releases\n\nParity requires these command-line programs:\n\n    git\n    heroku\n    pg_restore\n\nUsage\n-----\n\nBackup a database:\n\n    production backup\n    staging backup\n\nRestore a production or staging database backup into development:\n\n    development restore production\n    development restore staging\n\nOr, if `restore-from` reads better to you, it's the same thing:\n\n    development restore-from production\n    development restore-from staging\n\n * 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.\n\nPush your local development database backup up to staging:\n\n    staging restore development\n\nDeploy main to production (note that prior versions of Parity would run\ndatabase migrations, that's now better handled using [Heroku release phase]):\n\n    production deploy\n\n[Heroku release phase]: https://devcenter.heroku.com/articles/release-phase\n\nDeploy the current branch to staging:\n\n    staging deploy\n\n_Note that deploys to non-production environments use `git push --force`._\n\nOpen a console:\n\n    production console\n    staging console\n    pr_app 1234 console\n\nMigrate a database and restart the dynos:\n\n    production migrate\n    staging migrate\n    pr_app 1234 migrate\n\nTail a log:\n\n    production tail\n    staging tail\n    pr_app 1234 tail\n\nThe scripts also pass through, so you can do anything with them that you can do\nwith `heroku ______ --remote staging` or `heroku ______ --remote production`:\n\n    watch production ps\n    staging open\n\nYou can optionally parallelize a DB restore by passing `--parallelize`\nas a flag to the `development` or `production` commands:\n```\n    development restore-from production --parallelize\n```\n\n[2]: http://redis.io/commands\n\nConvention\n----------\n\nParity expects:\n\n* A `staging` remote pointing to the staging Heroku app.\n* A `production` remote pointing to the production Heroku app.\n```\nheroku git:remote -r staging -a your-staging-app\nheroku git:remote -r production -a your-production-app\n```\n* There is a `config/database.yml` file that can be parsed as YAML for\n  `['development']['database']`.\n\nPipelines\n---------\n\nIf you deploy review applications with Heroku pipelines, run commands against\nthose applications with the `pr_app` command, followed by the PR number for your\napplication:\n\n```\npr_app 1234 console\n```\n\nThis command assumes that your review applications have a name derived from the\nname of the application your `staging` Git remote points at.\n\nCustomization\n-------------\n\nIf you have Heroku environments beyond staging and production (such as a feature\nenvironment for each developer), you can add a [binstub] to the `bin` folder of\nyour application. Custom environments share behavior with staging: they can be\nbacked up and can restore from production.\n\nUsing feature environments requires including Parity as a gem in your\napplication's Gemfile.\n\n```ruby\ngem \"parity\"\n```\n\n[binstub]: https://github.com/sstephenson/rbenv/wiki/Understanding-binstubs\n\nHere's an example binstub for a 'feature-geoff' environment, hosted at\nmyapp-feature-geoff.herokuapp.com.\n\n```ruby\n#!/usr/bin/env ruby\n\nrequire \"parity\"\n\nif ARGV.empty?\n  puts Parity::Usage.new\nelse\n  Parity::Environment.new(\"feature-geoff\", ARGV).run\nend\n```\n\nIssues\n------\nPlease fill out our [issues template](.github/issue_template.md) if you are\nhaving problems.\n\nContributing\n------------\n\nPlease see [`CONTRIBUTING.md`](CONTRIBUTING.md) for details.\n\nVersion History\n---------------\n\nPlease see the [releases page](https://github.com/thoughtbot/parity/releases)\nfor the version history, along with a description of the changes in each\nrelease.\n\nReleasing\n---------\n\nSee guidelines in [`RELEASING.md`](RELEASING.md) for details\n\nLicense\n-------\n\nParity is © 2013 thoughtbot, inc.\nIt is free software,\nand may be redistributed under the terms specified in the [LICENSE] file.\n\n[LICENSE]: LICENSE\n\n\u003c!-- START /templates/footer.md --\u003e\n## About thoughtbot\n\n![thoughtbot](https://thoughtbot.com/thoughtbot-logo-for-readmes.svg)\n\nThis repo is maintained and funded by thoughtbot, inc.\nThe names and logos for thoughtbot are trademarks of thoughtbot, inc.\n\nWe love open source software!\nSee [our other projects][community].\nWe are [available for hire][hire].\n\n[community]: https://thoughtbot.com/community?utm_source=github\n[hire]: https://thoughtbot.com/hire-us?utm_source=github\n\n\n\u003c!-- END /templates/footer.md --\u003e\n","funding_links":["https://github.com/sponsors/thoughtbot"],"categories":["Plugins","Ruby","插件"],"sub_categories":["Omniauth"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtbot%2Fparity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoughtbot%2Fparity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtbot%2Fparity/lists"}