forked from SumoLogic/sumologic-kafka-push
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
80 lines (73 loc) · 2.67 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
import Dependencies._
import com.amazonaws.regions.{Region, Regions}
import com.typesafe.sbt.packager.docker.DockerPlugin.autoImport._
lazy val sumologicKafkaPush =
Project(id = "sumologic-kafka-push", base = file("."))
.enablePlugins(JavaAppPackaging)
.enablePlugins(AshScriptPlugin)
.enablePlugins(DockerPlugin)
.enablePlugins(EcrPlugin)
.enablePlugins(BuildInfoPlugin)
.settings(
name := "sumologic-kafka-push",
organization := "com.sumologic.kafkapush",
scalaVersion := Version.Scala,
organizationName := "SumoLogic",
description := "Push from Apache Kafka to Sumo Logic",
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoPackage := "info",
scalacOptions ++= Seq(
"-encoding", "UTF-8",
"-target:jvm-1.8",
"-Xlog-reflective-calls",
"-Xlint",
"-Ywarn-unused",
"-deprecation",
"-feature",
"-language:_",
"-unchecked"
),
scalacOptions in(Test, console) := (scalacOptions in(Compile, console)).value,
libraryDependencies ++= Vector(
TypesafeConfig,
AkkaTyped,
AkkaSlf4j,
AkkaStreamTyped,
AkkaHttp,
ScalaTest,
AkkaTypedTestKit,
AkkaHttp,
Logback,
Json4sNative,
Json4sExt,
AkkaHttpJson4s,
AkkaKafka,
ApacheKafkaClient,
// ApacheKafkaConnect,
PrometheusAkkaHttp,
PrometheusClient,
Re2j,
Guava,
Skuber,
ScalacacheCore,
ScalacacheGuava,
JsonPath,
Mockito
),
daemonUser in Docker := "sumo",
daemonGroup in Docker := "sumo",
daemonUserUid in Docker := Some("1000"),
daemonGroupGid in Docker := Some("1000"),
dockerExposedPorts in Docker ++= Seq(8080),
dockerRepository := Some("public.ecr.aws/sumologic"),
dockerUsername := Option(System.getenv("DOCKER_USERNAME")).orElse(None),
dockerBaseImage := "public.ecr.aws/sumologic/sumologic-kafka-push:focal-corretto-11",
)
region in Ecr := Region.getRegion(Regions.US_WEST_2)
repositoryName in Ecr := "sumologic/sumologic-kafka-push"
repositoryTags in Ecr := Seq(version.value)
localDockerImage in Ecr := (dockerRepository in Docker).value.map(repo => s"$repo/").getOrElse("") + (packageName in Docker).value + ":" + (version in Docker).value
// Create the repository before authentication takes place (optional)
//login in Ecr := ((login in Ecr) dependsOn (createRepository in Ecr)).value
// Authenticate and publish a local Docker image before pushing to ECR
push in Ecr := ((push in Ecr) dependsOn(publishLocal in Docker, login in Ecr)).value