mkUltra
mkUltra

Reputation: 3078

How can i export ENV variable with SBT?

I have my application.conf that use env variables, when I run my Play Scala application, I want to specify from witch file I need to export variables, for example: .loc.env or .dev.env ...

My .loc.env file looks like:

VAR_KEY1=value1
VAR_KEY2=value2

I don't want to create another application.conf

I use sbt 1.0 and Playframework 2.6

So my questions are:

How can i export env variable with sbt?

How can check env variable from sbt shell?

Upvotes: 0

Views: 1458

Answers (2)

Grigoriev Nick
Grigoriev Nick

Reputation: 1129

envVars in IntegrationTest := Map("imageTag" -> sys.env.getOrElse("imageTag", imageTag.value))

Upvotes: 3

cutoffurmind
cutoffurmind

Reputation: 487

You can reference ENV variables directly in application.conf for example like this:

slick.dbs.default.profile="slick.jdbc.MySQLProfile$"
slick.dbs.default.db.driver="com.mysql.jdbc.Driver"
slick.dbs.default.db.url=${?MYSQL_LINK}
slick.dbs.default.db.user = "root"
slick.dbs.default.db.password = ${?MYSQL_PASS}

Upvotes: 0

Related Questions