forked from lagom/lagom-java-chirper-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildTarget.scala
More file actions
50 lines (42 loc) · 1.49 KB
/
BuildTarget.scala
File metadata and controls
50 lines (42 loc) · 1.49 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import sbt._
object BuildTarget {
private sealed trait DeploymentRuntime
private case object ConductR extends DeploymentRuntime
private case object Kubernetes extends DeploymentRuntime
private case object Marathon extends DeploymentRuntime
private val deploymentRuntime: DeploymentRuntime = sys.props.get("buildTarget") match {
case Some(v) if v.toLowerCase == "conductr" =>
ConductR
case Some(v) if v.toLowerCase == "kubernetes" =>
Kubernetes
case Some(v) if v.toLowerCase == "marathon" =>
Marathon
case Some(v) =>
sys.error(s"The build target $v is not supported. Available: 'conductr', 'kubernetes', 'marathon'")
case None =>
ConductR
}
val additionalSettings = deploymentRuntime match {
case Kubernetes =>
Seq(
Keys.libraryDependencies ++= Seq(
Library.serviceLocatorDns
),
Keys.unmanagedResourceDirectories in Compile += Keys.sourceDirectory.value / "main" / "kubernetes-resources"
)
case Marathon =>
Seq(
Keys.libraryDependencies ++= Seq(
Library.serviceLocatorDns, Library.constructr, Library.constructrZooKeeper
),
Keys.unmanagedResourceDirectories in Compile += Keys.sourceDirectory.value / "main" / "marathon-resources"
)
case ConductR =>
Seq.empty
}
val dockerRepository: String = deploymentRuntime match {
case Kubernetes => "chirper"
case Marathon => "chirper-marathon"
case ConductR => "chirper-conductr"
}
}