-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
104 lines (91 loc) · 3.01 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
92
93
94
95
96
97
98
99
100
101
102
103
104
name := "finch-showcase"
organization := "km"
version := "2.0.0"
scalaVersion := "2.13.3"
resolvers ++= Seq(
Resolver.mavenLocal,
Resolver.jcenterRepo,
Resolver.sonatypeRepo("releases"),
"Confluent" at "https://packages.confluent.io/maven/"
)
libraryDependencies ++= Seq(
"com.github.scopt" %% "scopt" % "3.7.1",
"com.github.finagle" %% "finchx-core" % "0.32.1",
"io.monix" %% "monix" % "3.2.2",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.2",
"ch.qos.logback" % "logback-classic" % "1.2.3",
"org.apache.kafka" % "kafka-clients" % "2.4.1",
"software.amazon.awssdk" % "sqs" % "2.11.12",
"com.github.cb372" %% "cats-retry" % "1.1.0",
"nl.grons" %% "metrics4-scala" % "4.1.5",
"nl.grons" %% "metrics4-scala-hdr" % "4.1.5",
"io.dropwizard.metrics" % "metrics-jvm" % "4.1.5",
"io.dropwizard.metrics" % "metrics-graphite" % "4.1.5",
"io.circe" %% "circe-parser" % "0.13.0",
"io.circe" %% "circe-generic" % "0.13.0",
"at.favre.lib" % "bytes" % "1.3.0",
"org.scalatest" %% "scalatest" % "3.1.1" % Test,
"io.github.embeddedkafka" %% "embedded-kafka" % "2.4.1" % Test,
"org.elasticmq" %% "elasticmq-rest-sqs" % "0.15.6" % Test,
"co.fs2" %% "fs2-io" % "2.4.0" % Test
)
dependencyOverrides ++= Seq(
"io.dropwizard.metrics" % "metrics-core" % "4.1.5"
)
scalacOptions ++= Seq(
"-explaintypes",
"-deprecation",
"-feature",
"-Xfatal-warnings",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Wunused",
"-Xlint:inaccessible",
"-Xlint:infer-any",
"-Xlint:stars-align",
"-Xlint:nonlocal-return",
"-Xlint:constant",
"-Xlint:adapted-args"
)
excludeDependencies ++= Seq(
"log4j" % "log4j",
"org.slf4j" % "slf4j-log4j12"
)
assemblyMergeStrategy in assembly := {
case m if m.toLowerCase.endsWith("manifest.mf") => MergeStrategy.discard
case m if m.startsWith("META-INF") => MergeStrategy.discard
case PathList("org", "apache", xs @ _*) => MergeStrategy.first
case "about.html" => MergeStrategy.rename
case "reference.conf" => MergeStrategy.concat
case _ => MergeStrategy.first
}
assemblyOption in assembly := (assemblyOption in assembly).value.copy(cacheOutput = false)
assemblyJarName in assembly := "finch-showcase.jar"
enablePlugins(DockerPlugin)
dockerfile in docker := {
// The assembly task generates a fat JAR file
val artifact: File = assembly.value
val artifactTargetPath = s"/app/${artifact.name}"
val runScript = new File("scripts/run.sh")
// format: off
new Dockerfile {
from("openjdk:11-jre-slim")
expose(8080)
copy(artifact, artifactTargetPath)
copy(runScript, "/app")
entryPoint(
"./app/run.sh"
)
}
// format: on
}
imageNames in docker := Seq(
// Sets the latest tag
ImageName(s"${organization.value}/${name.value}:latest"),
// Sets a name with a tag that contains the project version
ImageName(
namespace = Some(organization.value),
repository = name.value,
tag = Some("v" + version.value)
)
)