#Pre-deploy environment variables

13 messages · Page 1 of 1 (latest)

hollow thistle
#

The docs for pre-deploy commands state:

They execute within your private network and have access to your application's environment variables.

I am assuming this means that they are available as shell variables, however running the following pre-deploy command results in failure, despite that variable being set in the "Variables" config section: /app/efbundle --version --connection "$ConnectionStrings__MyConnectionString"

Is this the intended usage of environment variables in this context?

Alternatively, is it possible to use interpolated variables like we would when setting the value of another variable, i.e. ${{Postgres.PGHOST}}, such that my pre-deploy command would then look like:

/app/efbundle --verbose --connection "Server=${{Postgres.PGHOST}} ..."

Cheers!

#

Well, my latter question is not the case:

bronze skiff
#

${{Postgres.PGHOST}} is Railway specific syntax.

hollow thistle
#

But when I reference the variable (presumably available in the shell), which is definitely set, I get a config error as if it's not seeing the variable.

#

(Which does exist!)

bronze skiff
hollow thistle
#

As a follow-up suggestion, perhaps have a little warning show up if the UI detects entry of "$BLAH" looking sequences?

bronze skiff
#

They are supported as is, as long as you use Railpack.

hollow thistle
#

My needs are too complex for magic 😛

bronze skiff
#

lol

hollow thistle
#

Anyhoo, thanks for the help! Can mark as solved. ^_^