-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.sbt
52 lines (39 loc) · 1.28 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
import com.typesafe.sbt.packager.docker.DockerPermissionStrategy
enablePlugins(GitVersioning, LauncherJarPlugin, DockerPlugin)
name := "hello-uzhttp"
scalaVersion := "2.13.4"
val zioVersion = "1.0.2"
libraryDependencies ++= Seq(
"org.polynote" %% "uzhttp" % "0.2.6",
"dev.zio" %% "zio-test-sbt" % zioVersion % Test,
)
scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-explaintypes",
"-feature",
"-Wconf:any:error",
"-Wunused",
"-Wvalue-discard",
)
testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework")
Global / cancelable := false
dockerUpdateLatest := true
dockerBaseImage := "gcr.io/distroless/java:11"
daemonUserUid in Docker := None
daemonUser in Docker := "root"
dockerPermissionStrategy := DockerPermissionStrategy.None
dockerEntrypoint := Seq("java", "-jar",s"/opt/docker/lib/${(artifactPath in packageJavaLauncherJar).value.getName}")
dockerCmd := Seq.empty
val maybeDockerSettings = sys.props.get("dockerImageUrl").flatMap { imageUrl =>
val parts = imageUrl.split("/")
if (parts.size == 3) {
Some((parts(0), parts(1), parts(2)))
}
else {
None
}
}
dockerRepository := maybeDockerSettings.map(_._1)
dockerUsername := maybeDockerSettings.map(_._2)
packageName in Docker := maybeDockerSettings.map(_._3).getOrElse(name.value)