# Using env variables in release\_command

**URL:** <https://community.fly.io/t/using-env-variables-in-release-command/7186>\
**Category:** General\
**Created:** [September 15, 2022, 4:01pm UTC](https://community.fly.io/t/using-env-variables-in-release-command/7186 "2022-09-15T16:01:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gaffneyc](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/gaffneyc/32/43670_2.png) [@gaffneyc](https://community.fly.io/u/gaffneyc)\
**Post date:** [September 15, 2022, 4:01pm UTC](https://community.fly.io/t/using-env-variables-in-release-command/7186/1 "2022-09-15T16:01:06Z")

</div>

Migrating an app from Heroku with Turboku and ran into some unexpected behavior with the release\_command not interpolating env variables ($VAR\_NAME) and passing the var string as is to the command (e.g. “$DATABASE\_URL” instead of “postgres://…”).

The fix was to wrap the command in a bash one liner.

```auto
[deploy]
  release_command = "migrate --path db/migrate --url $DATABASE_URL --timeout 300 up"

```

Wrap the command in a `bash -c ''` block.

```auto
[deploy]
  release_command = "bash -c 'migrate --path db/migrate --url $DATABASE_URL --timeout 300 up'"

```
