I want to add env variables to new instances

I want all my deployments to have access to postgres, thus I'm creating a plugin which sets up a new user with access to a new database (on a postgres server in a different container). I want to expose the database access with an env variable, just like heroku does. To me it looks like release is the best place to put this hook.