-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
135 lines (127 loc) · 4.38 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import sbtassembly.PathList
import wartremover.WartRemover.autoImport.Wart
import sbt.Keys.{ csrConfiguration, updateClassifiers, updateSbtClassifiers }
import lmcoursier.definitions.Authentication
import Settings._
inThisBuild(
Seq(
organization := "it.agilelab.provisioning",
scalaVersion := "2.13.2",
version := ComputeVersion.version
)
)
lazy val root = (project in file("."))
.settings(
name := "spark-workloads-provisioner",
mainClass in Compile := Some("it.agilelab.provisioning.spark.workloads.provisioner.app.Main"),
artifactorySettings,
dockerBuildOptions ++= Seq("--network=host"),
dockerBaseImage := "openjdk:11-buster",
dockerUpdateLatest := true,
daemonUser := "daemon",
Docker / version := (ThisBuild / version).value,
Docker / packageName :=
s"registry.gitlab.com/agilefactory/witboost.mesh/provisioning/cdp-refresh/witboost.mesh.provisioning.workload.cdp.spark",
Docker / dockerExposedPorts := Seq(8093)
)
.enablePlugins(JavaAppPackaging)
.aggregate(
core,
service,
api,
quartzScheduler
)
.dependsOn(
core,
service,
api,
quartzScheduler
)
lazy val core = (project in file("core"))
.settings(
name := "spark-workloads-provisioner-core",
libraryDependencies ++= Dependencies.testDependencies ++ Seq(
) ++ Dependencies.provisioningDependencies,
libraryDependencies ++= Dependencies.http4sDependencies,
libraryDependencies ++= Dependencies.jsonDependencies,
artifactorySettings,
commonAssemblySettings,
wartremoverSettings,
k8tyGitlabPluginSettings
)
.enablePlugins(K8tyGitlabPlugin)
lazy val service = (project in file("service"))
.settings(
name := "spark-workloads-provisioner-service",
libraryDependencies ++= Dependencies.testDependencies,
artifactorySettings,
commonAssemblySettings,
wartremoverSettings,
k8tyGitlabPluginSettings
)
.dependsOn(core, quartzScheduler)
.enablePlugins(K8tyGitlabPlugin)
lazy val api = (project in file("api"))
.settings(
name := "spark-workloads-provisioner-api",
libraryDependencies ++= Dependencies.testDependencies ++ Seq(
Dependencies.cronUtils
) ++ Dependencies.http4sDependencies ++ Dependencies.circeDependencies,
artifactorySettings,
commonAssemblySettings,
wartremoverSettings,
k8tyGitlabPluginSettings
)
.settings(
Compile / guardrailTasks := GuardrailHelpers.createGuardrailTasks((Compile / sourceDirectory).value / "openapi") {
openApiFile =>
List(
ScalaServer(
openApiFile.file,
pkg = "it.agilelab.provisioning.api.generated",
framework = "http4s",
tracing = false
)
)
},
coverageExcludedPackages := "it.agilelab.provisioning.api.generated.*"
)
.dependsOn(service)
.enablePlugins(K8tyGitlabPlugin)
lazy val quartzScheduler = (project in file("quartz-embedded-scheduler"))
.settings(
name := "spark-workloads-provisioner-quartz-embedded-scheduler",
libraryDependencies ++= Dependencies.testDependencies,
libraryDependencies ++= Dependencies.quartzAndLivyDependencies,
libraryDependencies ++= Dependencies.provisioningDependencies,
artifactorySettings,
commonAssemblySettings,
wartremoverSettings,
k8tyGitlabPluginSettings
)
.dependsOn(core)
.enablePlugins(K8tyGitlabPlugin)
lazy val commonAssemblySettings = Seq(
assemblyJarName in assembly := s"${name.value}-${version.value}.jar",
assemblyMergeStrategy in assembly := {
case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard
case PathList("META-INF", xs @ _*) => MergeStrategy.last
case PathList("org", "apache", "commons", "logging", x @ _*) => MergeStrategy.last
case PathList("mime.types") => MergeStrategy.last
case "NOTICE" => MergeStrategy.discard
case "LICENSE" => MergeStrategy.discard
case _ => MergeStrategy.last
}
)
lazy val wartremoverSettings = Seq(
wartremoverErrors in (Compile, compile) ++= Warts.allBut(
Wart.Nothing,
Wart.TraversableOps,
Wart.StringPlusAny,
Wart.ToString,
Wart.AsInstanceOf,
Wart.Any,
Wart.DefaultArguments
),
wartremoverExcluded += sourceManaged.value
)