-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sbt
51 lines (49 loc) · 1.7 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
lazy val `kafka-connect` =
(project in file("kafka-connect"))
.settings(
name := "kafka-connect",
organization := "com.agoda",
version := "1.0.0",
scalaVersion := "2.11.8",
libraryDependencies ++= Dependencies.Compile.kafkaConnect
)
.enablePlugins(UniversalPlugin, JavaServerAppPackaging)
.settings(
mainClass in Compile := Option("com.agoda.kafka.connect.Boot"),
mappings in Universal ++= {
val resourcesDirectory = (sourceDirectory in Compile).value / "resources"
for {
(file, relativePath) <- (resourcesDirectory.*** --- resourcesDirectory) pair relativeTo(resourcesDirectory)
} yield file -> s"conf/$relativePath"
}
)
.enablePlugins(sbtdocker.DockerPlugin)
.settings(
dockerfile in docker := {
val appDir: File = stage.value
val targetDir = "/app"
new Dockerfile {
from("java")
expose(8083)
copy(appDir, targetDir)
env(("CONFIG_FILE", "application.conf"))
entryPointRaw(s"$targetDir/bin/${executableScriptName.value} -Dconfig.file=$targetDir/conf/$${CONFIG_FILE}")
}
},
imageNames in docker := Seq(
ImageName(s"${organization.value}/${name.value}:latest"),
ImageName(Some(organization.value), Some(name.value), version.value)
),
buildOptions in docker := BuildOptions(
cache = false,
removeIntermediateContainers = BuildOptions.Remove.Always
)
)
lazy val `functional` =
(project in file("functional"))
.settings(
name := "functional",
scalaVersion := "2.11.8",
libraryDependencies ++= Dependencies.Test.functional,
fork in Test := true
)