heroku-review-apps-manager 
A command-line tool to manage Heroku Review Apps. This gem provides an easy way to list, create, and delete Heroku review apps associated with GitHub pull requests.
Installation
Install the gem by executing:
$ gem install heroku-review-apps-manager
Or add to your application's Gemfile:
gem 'heroku-review-apps-manager'
And then execute:
$ bundle install
Configuration
This tool requires the following environment variables to be set:
HEROKU_REVIEW_APPS_MANAGER_HEROKU_API_KEY
Your Heroku API key for authentication. You can find your API key in your Heroku Account Settings.
export HEROKU_REVIEW_APPS_MANAGER_HEROKU_API_KEY=your_heroku_api_key
HEROKU_REVIEW_APPS_MANAGER_GITHUB_TOKEN
Your GitHub personal access token (required for creating review apps). You can create a token in your GitHub Settings.
export HEROKU_REVIEW_APPS_MANAGER_GITHUB_TOKEN=your_github_token
Usage
List review apps
List all review apps for a given pipeline:
$ heroku-review-apps-manager list_app PIPELINE_NAME
With JSON output:
$ heroku-review-apps-manager list_app PIPELINE_NAME --json
Create a review app
Create a review app for a specific branch and pull request:
$ heroku-review-apps-manager create_app PIPELINE_NAME GITHUB_ORG REPOSITORY BRANCH
Example:
$ heroku-review-apps-manager create_app my-pipeline myorg myrepo feature-branch
With JSON output:
$ heroku-review-apps-manager create_app PIPELINE_NAME GITHUB_ORG REPOSITORY BRANCH --json
Delete a review app
Delete a review app for a specific branch:
$ heroku-review-apps-manager delete_app PIPELINE_NAME BRANCH
Example:
$ heroku-review-apps-manager delete_app my-pipeline feature-branch
With JSON output:
$ heroku-review-apps-manager delete_app PIPELINE_NAME BRANCH --json
Development
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/kakudou3/heroku-review-apps-manager. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the heroku-review-apps-manager project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
Author
kakudooo kakudou3@gmail.com