-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Environment-based configuration of DeriveClient (#22)
* Add support for DeriveClient host configuration * Remove some methods from FrontendUtils from a previous approach * Add zio.app namespace to serverhost config value * Update versions and add version vals to build.sbt * Remove nativeImageVersion from build.sbt * Alphabetize version vals * Revert quillZioVersion and update deploy.sh * Temporarily changing git info in TemplateGenerator for testing * Remove leftover debugging code, revert TemplateGenerator * Rename zio.app.serverhost to more accurately named zio.app.backendUri * Push "api" to dev/application.conf
- Loading branch information
1 parent
2e55fbb
commit d14cf08
Showing
16 changed files
with
258 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
.idea/ | ||
target/ | ||
node_modules | ||
cli/src/main/resources/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
sbt frontend/fullLinkJS | ||
BUILD_ENV=prod sbt frontend/fullLinkJS | ||
yarn exec vite -- build | ||
cp dist/index.html dist/200.html | ||
surge ./dist '$name$.surge.sh' | ||
cp frontend/target/scala-2.13/frontend*jar/prod/shocon.conf dist/assets/shocon.conf | ||
surge ./dist '$name$.surge.sh' |
1 change: 1 addition & 0 deletions
1
cli/src/main/g8/frontend/src/main/resources/dev/application.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
zio.app.backendUri = "api" |
1 change: 1 addition & 0 deletions
1
cli/src/main/g8/frontend/src/main/resources/prod/application.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
zio.app.backendUri = "https://changeme.wrong" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import sbt.Keys._ | ||
import sbt._ | ||
import sbt.plugins.JvmPlugin | ||
|
||
/** sets the build environment */ | ||
object BuildEnvPlugin extends AutoPlugin { | ||
|
||
// make sure it triggers automatically | ||
override def trigger = AllRequirements | ||
override def requires = JvmPlugin | ||
|
||
object autoImport { | ||
object BuildEnv extends Enumeration { | ||
val Production, Test, Development = Value | ||
} | ||
|
||
val buildEnv = settingKey[BuildEnv.Value]("the current build environment") | ||
} | ||
import autoImport._ | ||
|
||
override def projectSettings: Seq[Setting[_]] = Seq( | ||
buildEnv := { | ||
sys.props | ||
.get("env") | ||
.orElse(sys.env.get("BUILD_ENV")) | ||
.flatMap { | ||
case "prod" => Some(BuildEnv.Production) | ||
case "test" => Some(BuildEnv.Test) | ||
case "dev" => Some(BuildEnv.Development) | ||
case _ => None | ||
} | ||
.getOrElse(BuildEnv.Development) | ||
}, | ||
// give feed back | ||
onLoadMessage := { | ||
// depend on the old message as well | ||
val defaultMessage = onLoadMessage.value | ||
val env = buildEnv.value | ||
s"""|$defaultMessage | ||
|Running in build environment: $env""".stripMargin | ||
} | ||
) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.6.0") | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.0") | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1") | ||
addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1") | ||
addSbtPlugin("org.akka-js" % "sbt-shocon" % "1.0.0") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.