-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
116 lines (96 loc) · 3.33 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
105
106
107
108
109
110
111
112
113
114
115
116
import sbt.Keys.testFrameworks
import scala.util.Properties
ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / scalaVersion := "3.6.2"
lazy val zioVersion = "2.1.14"
lazy val zioConfigVersion = "3.0.7"
lazy val flywayVersion = "11.1.0"
lazy val circeVersion = "0.14.10"
lazy val testContainersVersion = "1.20.4"
lazy val zioDependencies = Seq(
"dev.zio" %% "zio" % zioVersion
)
lazy val zioHttpDependencies = Seq(
"dev.zio" %% "zio-http" % "3.0.1"
)
lazy val zioTestDependencies = Seq(
"dev.zio" %% "zio-test" % zioVersion % Test,
"dev.zio" %% "zio-test-sbt" % zioVersion % Test,
"dev.zio" %% "zio-test-magnolia" % zioVersion % Test,
"dev.zio" %% "zio-mock" % "1.0.0-RC12" % Test
)
lazy val zioConfigDependencies = Seq(
"dev.zio" %% "zio-config" % zioConfigVersion,
"dev.zio" %% "zio-config-magnolia" % zioConfigVersion,
"dev.zio" %% "zio-config-typesafe" % zioConfigVersion
)
lazy val circeDependencies = Seq(
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
"io.circe" %% "circe-literal" % circeVersion
)
lazy val flywayDependencies = Seq(
"org.flywaydb" % "flyway-core" % flywayVersion,
"org.flywaydb" % "flyway-mysql" % flywayVersion
)
lazy val testContainersDependencies = Seq(
"org.testcontainers" % "testcontainers" % testContainersVersion % Test,
"org.testcontainers" % "mysql" % testContainersVersion % Test
)
lazy val loggingDependencies = Seq(
"org.slf4j" % "slf4j-api" % "2.0.16",
"ch.qos.logback" % "logback-classic" % "1.5.15"
)
lazy val databaseDependencies = Seq(
"dev.zio" %% "zio-interop-cats" % "23.1.0.3",
"org.tpolecat" %% "doobie-hikari" % "1.0.0-RC6",
"com.mysql" % "mysql-connector-j" % "9.1.0",
"com.h2database" % "h2" % "2.3.232" % Test
)
lazy val root = (project in file("."))
.aggregate(application)
.settings(
commands += Command.command("integrationTest") { state =>
"Docker/publishLocal" ::
"project integration-test" ::
"test" ::
state
}
)
lazy val application = (project in file("application"))
.enablePlugins(
DockerPlugin,
JavaAppPackaging
)
.settings(
name := "testcontainers-zio",
libraryDependencies ++=
zioDependencies ++
zioConfigDependencies ++
zioHttpDependencies ++
zioTestDependencies ++
circeDependencies ++
flywayDependencies ++
databaseDependencies ++
loggingDependencies ++
testContainersDependencies,
Test / run / fork := true,
testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"),
Compile / packageDoc / publishArtifact := false,
scalacOptions ++= Seq("-indent", "-rewrite"),
Docker / packageName := "application",
dockerBaseImage := "eclipse-temurin:19.0.2_7-jdk",
dockerExposedPorts += 8080,
dockerAliases ++= Seq(Properties.propOrNone("build"), Some("latest")).flatten.map(tag => dockerAlias.value.withTag(Some(tag)))
)
lazy val `integration-test` = (project in file("integration-test"))
.settings(
scalacOptions ++= Seq("-indent", "-rewrite"),
libraryDependencies ++=
zioHttpDependencies ++
zioTestDependencies ++
circeDependencies ++
loggingDependencies ++
testContainersDependencies
)