A long-lived project that still receives updates
heroku-review-apps-manager provides a command-line interface to list, create, and delete Heroku review apps associated with GitHub pull requests. It simplifies the management of review apps in your CI/CD pipeline.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

heroku-review-apps-manager Gem Version

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 OAuth token for authentication. You can create an OAuth token using the heroku-oauth toolbelt plugin.

$ heroku plugins:install heroku-cli-oauth
$ heroku authorizations:create -d "Heroku Review Apps Manager Example Token"
export HEROKU_REVIEW_APPS_MANAGER_HEROKU_API_KEY=your_heroku_oauth_token

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.

This tool requires the following repository permissions:

export HEROKU_REVIEW_APPS_MANAGER_GITHUB_TOKEN=your_github_token

HEROKU_REVIEW_APPS_MANAGER_PIPELINE_NAME (Optional)

The default Heroku pipeline name. This is used as a fallback when the pipeline name is not specified in commands.

export HEROKU_REVIEW_APPS_MANAGER_PIPELINE_NAME=my-pipeline

HEROKU_REVIEW_APPS_MANAGER_TARGET_GITHUB_REPOSITORY (Optional)

The default GitHub repository in the format org/repo (e.g., myorg/myrepo). This is used as a fallback when the repository is not specified in the create-app command.

export HEROKU_REVIEW_APPS_MANAGER_TARGET_GITHUB_REPOSITORY=myorg/myrepo

Usage

List review apps

List all review apps for a given pipeline:

$ heroku-review-apps-manager list-app [--pipeline PIPELINE_NAME]

The --pipeline option is optional. If not provided, it will use the value from the HEROKU_REVIEW_APPS_MANAGER_PIPELINE_NAME environment variable.

With JSON output:

$ heroku-review-apps-manager list-app [--pipeline PIPELINE_NAME] --json

Create a review app

Create a review app for a specific branch and pull request:

$ heroku-review-apps-manager create-app --branch BRANCH [--pipeline PIPELINE_NAME] [--repository REPOSITORY]

The --branch option is required. The --pipeline option is optional. If not provided, it will use the value from the HEROKU_REVIEW_APPS_MANAGER_PIPELINE_NAME environment variable.

The --repository option is optional. If not provided, it will use the value from the HEROKU_REVIEW_APPS_MANAGER_TARGET_GITHUB_REPOSITORY environment variable. The repository should be in the format org/repo.

Example with all parameters specified:

$ heroku-review-apps-manager create-app --branch feature-branch --pipeline my-pipeline --repository myorg/myrepo

Example using environment variables:

$ heroku-review-apps-manager create-app --branch feature-branch

With JSON output:

$ heroku-review-apps-manager create-app --branch BRANCH [--pipeline PIPELINE_NAME] [--repository REPOSITORY] --json

List review app formations

List formation info for a review app by branch:

$ heroku-review-apps-manager list-formation --branch BRANCH [--pipeline PIPELINE_NAME]

The --branch option is required. The --pipeline option is optional. If not provided, it will use the value from the HEROKU_REVIEW_APPS_MANAGER_PIPELINE_NAME environment variable.

With JSON output:

$ heroku-review-apps-manager list-formation --branch BRANCH [--pipeline PIPELINE_NAME] --json

Update review app formation quantity

Update formation quantity (default process type is web) for a review app by branch:

$ heroku-review-apps-manager update-formation --branch BRANCH [--pipeline PIPELINE_NAME] --quantity QUANTITY

The --branch option is required. The --pipeline option is optional. If not provided, it will use the value from the HEROKU_REVIEW_APPS_MANAGER_PIPELINE_NAME environment variable. The --formation-type option is optional. If not provided, it defaults to web. The --quantity option is optional. If not provided, it defaults to 1.

With JSON output:

$ heroku-review-apps-manager update-formation --branch BRANCH [--pipeline PIPELINE_NAME] --quantity QUANTITY --json

Specify formation type:

$ heroku-review-apps-manager update-formation --branch BRANCH [--pipeline PIPELINE_NAME] --quantity QUANTITY --formation-type worker

Show a review app

Show app and database connection info for a review app by branch:

$ heroku-review-apps-manager show-app --branch BRANCH [--pipeline PIPELINE_NAME]

The --branch option is required. The --pipeline option is optional. If not provided, it will use the value from the HEROKU_REVIEW_APPS_MANAGER_PIPELINE_NAME environment variable.

With JSON output:

$ heroku-review-apps-manager show-app --branch BRANCH [--pipeline PIPELINE_NAME] --json

Delete a review app

Delete a review app for a specific branch:

$ heroku-review-apps-manager delete-app --branch BRANCH [--pipeline PIPELINE_NAME]

The --branch option is required. The --pipeline option is optional. If not provided, it will use the value from the HEROKU_REVIEW_APPS_MANAGER_PIPELINE_NAME environment variable.

Example with pipeline name specified:

$ heroku-review-apps-manager delete-app --branch feature-branch --pipeline my-pipeline

Example using environment variable:

$ heroku-review-apps-manager delete-app --branch feature-branch

With JSON output:

$ heroku-review-apps-manager delete-app --branch BRANCH [--pipeline PIPELINE_NAME] --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