-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sbt
112 lines (88 loc) · 4.09 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
name := "director-v2"
organization := "com.advancedtelematic"
scalaVersion := "2.12.10"
scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8", "-Ypartial-unification")
resolvers += "ATS Releases" at "https://nexus.ota.here.com/content/repositories/releases"
resolvers += "ATS Snapshots" at "https://nexus.ota.here.com/content/repositories/snapshots"
libraryDependencies ++= {
val akkaV = "2.6.5"
val akkaHttpV = "10.1.12"
val scalaTestV = "3.0.8"
val bouncyCastleV = "1.59"
val tufV = "0.7.4-21-g94b8744"
val libatsV = "0.4.1-10-gc950158"
Seq(
"com.typesafe.akka" %% "akka-actor" % akkaV,
"com.typesafe.akka" %% "akka-stream" % akkaV,
"com.typesafe.akka" %% "akka-http" % akkaHttpV,
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpV,
"com.typesafe.akka" %% "akka-stream-testkit" % akkaV,
"com.typesafe.akka" %% "akka-slf4j" % akkaV,
"org.scalatest" %% "scalatest" % scalaTestV % Test,
"org.scalacheck" %% "scalacheck" % "1.13.4" % "test",
"com.advancedtelematic" %% "libats" % libatsV,
"com.advancedtelematic" %% "libats-messaging" % libatsV,
"com.advancedtelematic" %% "libats-messaging-datatype" % libatsV,
"com.advancedtelematic" %% "libats-metrics-akka" % libatsV,
"com.advancedtelematic" %% "libats-metrics-prometheus" % libatsV,
"com.advancedtelematic" %% "libats-http-tracing" % libatsV,
"com.advancedtelematic" %% "libats-slick" % libatsV,
"com.advancedtelematic" %% "libats-logging" % libatsV,
"com.advancedtelematic" %% "libats-auth" % libatsV,
"com.advancedtelematic" %% "libtuf" % tufV,
"com.advancedtelematic" %% "libtuf-server" % tufV,
"org.bouncycastle" % "bcprov-jdk15on" % bouncyCastleV,
"org.bouncycastle" % "bcpkix-jdk15on" % bouncyCastleV,
"org.scala-lang.modules" %% "scala-async" % "0.9.6",
"org.mariadb.jdbc" % "mariadb-java-client" % "2.2.1"
)
}
scalacOptions in Compile ++= Seq(
"-deprecation",
"-feature",
"-Xlog-reflective-calls",
"-Yno-adapted-args",
"-Ypartial-unification"
)
testOptions in Test ++= Seq(
Tests.Argument(TestFrameworks.ScalaTest, "-u", "target/test-reports"),
Tests.Argument(TestFrameworks.ScalaTest, "-oDS")
)
enablePlugins(BuildInfoPlugin, GitVersioning, JavaAppPackaging)
buildInfoOptions += BuildInfoOption.ToMap
buildInfoOptions += BuildInfoOption.BuildTime
mainClass in Compile := Some("com.advancedtelematic.director.Boot")
import com.typesafe.sbt.packager.docker._
import sbt.Keys._
import com.typesafe.sbt.SbtNativePackager.Docker
import DockerPlugin.autoImport._
import com.typesafe.sbt.SbtGit.git
import com.typesafe.sbt.SbtNativePackager.autoImport._
import com.typesafe.sbt.packager.linux.LinuxPlugin.autoImport._
dockerRepository in Docker := Some("advancedtelematic")
packageName in Docker := packageName.value
dockerUpdateLatest := true
dockerAliases ++= Seq(dockerAlias.value.withTag(git.gitHeadCommit.value))
defaultLinuxInstallLocation in Docker := s"/opt/${moduleName.value}"
dockerCommands := Seq(
Cmd("FROM", "advancedtelematic/alpine-jre:adoptopenjdk-jre8u262-b10"),
ExecCmd("RUN", "mkdir", "-p", s"/var/log/${moduleName.value}"),
Cmd("ADD", "opt /opt"),
Cmd("WORKDIR", s"/opt/${moduleName.value}"),
ExecCmd("ENTRYPOINT", s"/opt/${moduleName.value}/bin/${moduleName.value}"),
Cmd("RUN", s"chown -R daemon:daemon /opt/${moduleName.value}"),
Cmd("RUN", s"chown -R daemon:daemon /var/log/${moduleName.value}"),
Cmd("USER", "daemon")
)
fork := true
sonarProperties ++= Map(
"sonar.projectName" -> "OTA Connect Director",
"sonar.projectKey" -> "ota-connect-director",
"sonar.host.url" -> "https://sonar7.devtools.in.here.com",
"sonar.links.issue" -> "https://saeljira.it.here.com/projects/OTA/issues",
"sonar.links.scm" -> "https://main.gitlab.in.here.com/olp/edge/ota/connect/back-end/director",
"sonar.links.ci" -> "https://main.gitlab.in.here.com/olp/edge/ota/connect/back-end/director/pipelines",
"sonar.java.binaries" -> "./target/scala-*/classes",
"sonar.scala.coverage.reportPaths"->"target/scala-2.12/scoverage-report/scoverage.xml",
"sonar.projectVersion" -> version.value,
"sonar.language" -> "scala")