You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to set envVars for revolver? Here's my interpretation of the readme applied to a scenario where I want my dev server to run locally with dev only env vars:
addCommandAlias(
"server-dev",
"; project server" +
"; set envVars in reStart := Map(\"aws_region\" -> \"us-east-1\")" +
"; reStart"
)
but I cannot access those variables in any task that restart triggers, e.g. this fails:println(sys.env("aws_region"))
of course I can get this working simply by exporting manually, like:
export aws_region=us-east-1 && sbt server-dev
The text was updated successfully, but these errors were encountered:
simplest way I've managed to do this is calling a bash script from an sbt task that in turn sets environment and then runs sbt. This way, the environment variables exported from the bash script are injected into the process sbt is running on.
leaving open in case there's a simpler approach, otherwise feel free to close if this is it:
lazy val bashTask = taskKey[Unit]("exports env vars and calls the sbt build with those vars injected")
lazy val bashTaskSetting = bashTask := {
import scala.sys.process._
Seq("scripts/setEnv.sh", "args") !
}
addCommandAlias(
"set-env-then-build",
"; bashTask"
)
Is there a way to set envVars for revolver? Here's my interpretation of the readme applied to a scenario where I want my dev server to run locally with dev only env vars:
but I cannot access those variables in any task that restart triggers, e.g. this fails:
println(sys.env("aws_region"))
of course I can get this working simply by exporting manually, like:
The text was updated successfully, but these errors were encountered: