-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
35 lines (31 loc) · 1.18 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import NativePackagerHelper._
name := "my-app"
libraryDependencies += "com.typesafe" % "config" % "1.3.0"
enablePlugins(JavaAppPackaging)
enablePlugins(AshScriptPlugin)
dockerBaseImage := "openjdk:8-jre-alpine"
//javaOptions will be copied in /opt/docker/conf/application.ini
javaOptions in Universal ++= {
val confFile = buildEnv.value match {
case BuildEnv.Developement => "application.conf"
case BuildEnv.Test => "test.conf"
case BuildEnv.Stage => "stage.conf"
case BuildEnv.Production => "prod.conf"
}
Seq(
s"-Dconfig.file=/opt/docker/conf/$confFile"
)
}
//Docker plugin depends on universal plugin so It will map configuration to /opt/docker/conf
/*mappings in Universal += {
// logic like this belongs into an AutoPlugin
val confFile = buildEnv.value match {
case BuildEnv.Developement => "application.conf"
case BuildEnv.Test => "test.conf"
case BuildEnv.Stage => "stage.conf"
case BuildEnv.Production => "prod.conf"
}
((resourceDirectory in Compile).value) -> "conf"
}*/
// copy configuration files to config directory
mappings in Universal ++= contentOf("src/main/resources").map{ case(f,name)=>f -> s"conf/$name"}