mirror of https://github.com/pressly/goose.git
Merged in josharian/goose/update-heroku-docs (pull request #3: Update heroku docs)
commit
85fac2eb96
10
README.md
10
README.md
|
@ -130,19 +130,23 @@ goose will expand environment variables in the `open` element. For an example, s
|
||||||
|
|
||||||
## Using goose with Heroku
|
## Using goose with Heroku
|
||||||
|
|
||||||
goose plays nicely with Heroku. These instructions assume that you're using [Keith Rarick's Heroku Go buildpack](https://github.com/kr/heroku-buildpack-go). First, make sure that Heroku builds the goose executable during deployment by adding an (unused) import to your app:
|
These instructions assume that you're using [Keith Rarick's Heroku Go buildpack](https://github.com/kr/heroku-buildpack-go). First, add a file to your project called (e.g.) `install_goose.go` to trigger building of the goose executable during deployment, with these contents:
|
||||||
|
|
||||||
|
// use build constraints to work around http://code.google.com/p/go/issues/detail?id=4210
|
||||||
|
// +build heroku
|
||||||
|
package main
|
||||||
|
|
||||||
import _ "bitbucket.org/liamstask/goose"
|
import _ "bitbucket.org/liamstask/goose"
|
||||||
|
|
||||||
[Set up your Heroku database(s) as usual.](https://devcenter.heroku.com/articles/heroku-postgresql)
|
[Set up your Heroku database(s) as usual.](https://devcenter.heroku.com/articles/heroku-postgresql)
|
||||||
|
|
||||||
Then make use of environment variable expansion in your `dbconf.yml`, such as:
|
Then make use of environment variable expansion in your `dbconf.yml`:
|
||||||
|
|
||||||
production:
|
production:
|
||||||
driver: postgres
|
driver: postgres
|
||||||
open: $DATABASE_URL
|
open: $DATABASE_URL
|
||||||
|
|
||||||
To run migrations in production, use `heroku run`, e.g.:
|
To run goose in production, use `heroku run`:
|
||||||
|
|
||||||
heroku run goose -env production up
|
heroku run goose -env production up
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue