最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Pass environment variables to Flyway config - Stack Overflow

programmeradmin2浏览0评论

I've been searching ages for this, so I'm going to answer this question myself...

How do I use and reference system environment variables in a flyway configuration file?

I've been searching ages for this, so I'm going to answer this question myself...

How do I use and reference system environment variables in a flyway configuration file?

Share Improve this question asked Mar 14 at 10:40 BokettoBoketto 9859 silver badges22 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

You have to add the env. namespace before the envar name, and wrap it in ${env.MY_ENVAR_NAME}.

Example:

Setting up an exemplary environment variable, e.g. in bash

export MY_ENVAR_KEY=MY_ENVAR_VALUE

Using the environment variable in the flyway.toml

...

[environments.dev]
url = "jdbc:snowflake://something.snowflakecomputing/?db=SOME_DB&warehouse=SOME_WH&role=SOME_ROLED&schema=SOME_SCHEMA&authenticator=snowflake_jwt&private_key_file=path/to/snowflake.p8&jdbc_query_result_format=json&private_key_file_pwd=${env.MY_ENVAR_KEY}"

...
发布评论

评论列表(0)

  1. 暂无评论