-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
91 lines (71 loc) · 2.4 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import AssemblyKeys._
import DockerKeys._
import sbt.Keys._
import sbtdocker.mutable.Dockerfile
import sbtdocker.ImageName
name := "router"
organization := "systemzoo"
version := "1"
startYear := Some(2015)
/* scala versions and options */
scalaVersion := "2.11.2"
val akka = "2.3.3"
val spray = "1.3.2"
/* dependencies */
libraryDependencies ++= Seq (
"com.typesafe.akka" %% "akka-actor" % akka
// -- json --
,"io.spray" %% "spray-json" % "1.3.1"
// -- testing --
,"org.scalatest" %% "scalatest" % "2.2.1" % "test"
,"io.spray" %% "spray-testkit" % spray % "test"
// -- Spray --
,"io.spray" %% "spray-routing" % spray
,"io.spray" %% "spray-client" % spray
// -- Logging --
,"ch.qos.logback" % "logback-classic" % "1.1.2"
,"com.typesafe.scala-logging" %% "scala-logging-slf4j" % "2.1.2"
,"com.typesafe" % "config" % "1.2.1"
// -- Caching --
,"com.google.guava" % "guava" % "18.0"
,"com.google.code.findbugs" % "jsr305" % "1.3.9"
,"com.typesafe.akka" %% "akka-slf4j" % "2.3.6"
// -- decoding --
,"commons-codec" % "commons-codec" % "1.2"
).map(_.force())
/* avoid duplicate slf4j bindings */
libraryDependencies ~= { _.map(_.exclude("org.slf4j", "slf4j-jdk14")) }
resolvers ++= Seq(
"spray repo" at "http://repo.spray.io",
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("snapshots")
)
val testSettings = Seq(
fork in Test := true,
javaOptions in Test := Seq("-Denv=local")
)
testSettings
test in assembly := {}
net.virtualvoid.sbt.graph.Plugin.graphSettings
assemblySettings
mainClass in assembly := Some("com.systemzoo.Router")
dockerSettings
docker <<= (docker dependsOn assembly)
dockerfile in docker := {
val artifact = (outputPath in assembly).value
val artifactTargetPath = s"/app/${artifact.name}"
new Dockerfile {
from("develar/java")
add(artifact, artifactTargetPath)
entryPoint("java", "-Denv=prod", "-jar", artifactTargetPath)
expose(80)
}
}
imageName in docker := {
ImageName(
namespace = Some(organization.value),
repository = name.value,
tag = Some("latest")
)
}
Seq(Revolver.settings: _*)