-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.sbt
91 lines (86 loc) · 4.15 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
ThisBuild / tlBaseVersion := "1.0"
ThisBuild / organization := "dev.holt"
ThisBuild / organizationName := "PlanetHolt"
ThisBuild / homepage := Option(url("https://github.com/bpholt/fake-ec2-metadata-service"))
ThisBuild / startYear := Some(2015)
ThisBuild / licenses := Seq(License.MIT)
ThisBuild / developers := List(
tlGitHubDev("bpholt", "Brian Holt")
)
ThisBuild / scalaVersion := "2.13.15"
ThisBuild / githubWorkflowScalaVersions := Seq("2.13")
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("17"))
ThisBuild / githubWorkflowTargetTags := Seq("v*")
ThisBuild / githubWorkflowBuild += WorkflowStep.Sbt(List("Docker/stage"))
ThisBuild / githubWorkflowPublishPreamble := Seq(
WorkflowStep.Use(name = Option("Set up QEMU"), ref = UseRef.Public("docker", "setup-qemu-action", "v2")),
WorkflowStep.Use(name = Option("Set up Docker Buildx"), ref = UseRef.Public("docker", "setup-buildx-action", "v2")),
WorkflowStep.Use(name = Option("DockerHub Login"), ref = UseRef.Public("docker", "login-action", "v2"), params = Map(
"username" -> "${{ secrets.DOCKERHUB_USERNAME }}",
"password" -> "${{ secrets.DOCKERHUB_TOKEN }}",
)),
)
ThisBuild / githubWorkflowPublish := Seq(
WorkflowStep.Use(id = Option("meta"), name = Option("Docker meta"), ref = UseRef.Public("docker", "metadata-action", "v4"), params = Map(
"images" ->
(`fake-ec2-metadata-service` / dockerUsername)
.value
.foldRight((`fake-ec2-metadata-service` / Docker / name).value) {
List(_, _).mkString("/")
},
"tags" -> "type=semver,pattern={{raw}}"
)),
WorkflowStep.Use(name = Option("Build and push"), ref = UseRef.Public("docker", "build-push-action", "v4"), params = Map(
"context" -> (`fake-ec2-metadata-service` / Docker / stagingDirectory).value.relativeTo((root / baseDirectory).value).get.getPath,
"platforms" -> "linux/amd64,linux/arm64",
"push" -> "${{ github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) }}",
"tags" -> "${{ steps.meta.outputs.tags }}",
)),
)
ThisBuild / githubWorkflowPublishTargetBranches := Seq(RefPredicate.StartsWith(Ref.Tag("v")))
ThisBuild / tlCiMimaBinaryIssueCheck := false
ThisBuild / mergifyStewardConfig ~= {
_.map(_.copy(mergeMinors = true))
}
lazy val root = project.in(file(".")).enablePlugins(NoPublishPlugin).aggregate(
`fake-ec2-metadata-service`
)
lazy val `fake-ec2-metadata-service` = project
.in(file("core"))
.settings(
name := "fake-ec2-metadata-service",
libraryDependencies ++= Seq(
"org.http4s" %% "http4s-ember-server" % "0.23.30",
"org.http4s" %% "http4s-dsl" % "0.23.30",
"org.http4s" %% "http4s-circe" % "0.23.30",
"com.comcast" %% "ip4s-core" % "3.6.0",
"io.circe" %% "circe-core" % "0.14.10",
"io.circe" %% "circe-generic" % "0.14.10",
"io.circe" %% "circe-literal" % "0.14.10",
"dev.holt" %% "java-time-literals" % "1.1.1",
"software.amazon.awssdk" % "profiles" % "2.29.37",
"io.monix" %% "newtypes-core" % "0.2.3",
"org.typelevel" %% "mouse" % "1.3.2",
"ch.qos.logback" % "logback-classic" % "1.5.13" % Runtime,
"org.typelevel" %% "munit-cats-effect" % "2.0.0-M4" % Test,
"org.typelevel" %% "scalacheck-effect-munit" % "2.0.0-M2" % Test,
"org.http4s" %% "http4s-client" % "0.23.30" % Test,
"com.comcast" %% "ip4s-test-kit" % "3.6.0" % Test,
"eu.timepit" %% "refined-scalacheck" % "0.11.2" % Test,
"org.typelevel" %% "cats-testkit" % "2.12.0" % Test,
"org.typelevel" %% "cats-laws" % "2.12.0" % Test,
"org.typelevel" %% "discipline-munit" % "2.0.0-M3" % Test,
),
dockerUsername := Option("bpholt"),
dockerBaseImage := "eclipse-temurin:17",
dockerExposedPorts += 8169,
dockerUpdateLatest := true,
dockerLabels :=
Map(
"org.opencontainers.image.version" -> version.value,
"org.opencontainers.image.authors" -> developers.value.map(x => s"${x.name} <${x.url}>").mkString(", "),
) ++
scmInfo.value.map(_.browseUrl.toString).map("org.opencontainers.image.source" -> _) ++
git.gitHeadCommit.value.map("org.opencontainers.image.revision" -> _)
)
.enablePlugins(JavaServerAppPackaging, DockerPlugin)