Skip to content

Instantly share code, notes, and snippets.

@ike-delorenzo
Last active November 22, 2016 22:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ike-delorenzo/3291b4c8274198ce70f94485b0372f1c to your computer and use it in GitHub Desktop.
Save ike-delorenzo/3291b4c8274198ce70f94485b0372f1c to your computer and use it in GitHub Desktop.
Using Add-ons that do not yet support async provisioning in temporary deployments (Review apps and CI apps)

Using Add-ons that do not yet support async provisioning in temporary deployments (Review apps and CI apps)

Not all add-ons currently use Heroku's new asynchronous provisioning mechanism.

For add-ons that do not yet support async provisioning, you can force the build to poll the add-ons and thus wait for it to provision. Heroku Redis and Heroku Postgres do not yet support async provisioning and will currently require the steps below.

Step-by-step, with examples

e.g.:

    "buildpacks": [
	    {"url": "https://github.com/heroku/heroku-buildpack-redis.git"},
	    {"url": "https://github.com/heroku/heroku-buildpack-ruby.git"},
	    {"url": "https://github.com/heroku/heroku-buildpack-addon-wait.git"}
  ]

Make sure the add-on is specified in the add-ons part of your app-ci.json file (or app.json file for Review apps).

The addon(s) should be specified here even if you've already listed the add-ons in your app.json file.

e.g.

   "addons": [
    "heroku-postgresql",
    "heroku-redis"
  ],

In your app-ci.json, specify "bin/addon-wait" in your test-setup.

e.g.

"scripts": {
    "test-setup": "bundle install --with test && bin/addon-wait && bundle exec rake db:schema:load db:migrate", "test": "bundle exec rspec -f RspecTap::Formatter"
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment