-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.sbt
125 lines (108 loc) · 5.19 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
import com.typesafe.sbt.packager.archetypes.systemloader.ServerLoader.Systemd
import play.sbt.PlayImport.PlayKeys._
import sbt.Keys.libraryDependencies
import scala.concurrent.duration.DurationInt
// common settings (apply to all projects)
ThisBuild / organization := "com.gu"
ThisBuild / version := "0.5.0"
ThisBuild / scalaVersion := "2.13.16"
ThisBuild / scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked", "-Xfatal-warnings")
resolvers += DefaultMavenRepository
val awsSdkVersion = "2.29.52"
val playJsonVersion = "3.0.4"
val jacksonVersion = "2.18.2"
val mergeStrategySettings= assemblyMergeStrategy := {
case PathList(ps@_*) if ps.last == "module-info.class" => MergeStrategy.discard
case _ => MergeStrategy.first
}
lazy val hq = (project in file("hq"))
.enablePlugins(PlayScala, SbtWeb, JDebPackaging, SystemdPlugin)
.disablePlugins(sbtassembly.AssemblyPlugin)
.settings(
name := """security-hq""",
playDefaultPort := 9090,
fileDescriptorLimit := Some("16384"), // This increases the number of open files allowed when running in AWS
libraryDependencies ++= Seq(
ws,
filters,
"com.gu.play-googleauth" %% "play-v30" % "20.0.0",
"com.gu.play-secret-rotation" %% "play-v30" % "13.1.2",
"com.gu.play-secret-rotation" %% "aws-parameterstore-sdk-v2" % "13.1.2",
"joda-time" % "joda-time" % "2.13.0",
"org.typelevel" %% "cats-core" % "2.13.0",
"com.github.tototoshi" %% "scala-csv" % "2.0.0",
"software.amazon.awssdk" % "iam" % awsSdkVersion,
"software.amazon.awssdk" % "cloudformation" % awsSdkVersion,
"software.amazon.awssdk" % "cloudwatch" % awsSdkVersion,
"software.amazon.awssdk" % "dynamodb" % awsSdkVersion,
"software.amazon.awssdk" % "ec2" % awsSdkVersion,
"software.amazon.awssdk" % "efs" % awsSdkVersion,
"software.amazon.awssdk" % "s3" % awsSdkVersion,
"software.amazon.awssdk" % "sns" % awsSdkVersion,
"software.amazon.awssdk" % "ssm" % awsSdkVersion,
"software.amazon.awssdk" % "sts" % awsSdkVersion,
"software.amazon.awssdk" % "support" % awsSdkVersion,
"com.vladsch.flexmark" % "flexmark" % "0.64.8",
"io.reactivex" %% "rxscala" % "0.27.0",
"com.fasterxml.jackson.core" % "jackson-databind" % jacksonVersion,
"com.fasterxml.jackson.module" %% "jackson-module-scala" % jacksonVersion,
"org.scalatest" %% "scalatest" % "3.2.19" % Test,
"org.scalatestplus" %% "scalacheck-1-16" % "3.2.14.0" % Test,
"org.scalacheck" %% "scalacheck" % "1.18.1" % Test,
"com.github.alexarchambault" %% "scalacheck-shapeless_1.15" % "1.3.0" % Test,
"com.gu" %% "anghammarad-client" % "4.0.0",
"ch.qos.logback" % "logback-classic" % "1.5.16",
// logstash-logback-encoder brings in version 2.11.0
// exclude transitive dependency to avoid a runtime exception:
// `com.fasterxml.jackson.databind.JsonMappingException: Scala module 2.10.2 requires Jackson Databind version >= 2.10.0 and < 2.11.0`
"net.logstash.logback" % "logstash-logback-encoder" % "8.0" exclude("com.fasterxml.jackson.core", "jackson-databind"),
"com.gu" %% "janus-config-tools" % "1.0.0"
),
Assets / pipelineStages := Seq(digest),
// exclude docs
Compile / doc / sources := Seq.empty,
Universal / packageName := "security-hq",
// include beanstalk config files in the zip produced by `dist`
Universal / mappings ++=
(baseDirectory.value / "beanstalk" * "*" get)
.map(f => f -> s"beanstalk/${f.getName}"),
// include upstart config files in the zip produced by `dist`
Universal / mappings ++=
(baseDirectory.value / "upstart" * "*" get)
.map(f => f -> s"upstart/${f.getName}"),
// include systemd config files in the zip produced by `dist`
Universal / mappings ++=
(baseDirectory.value / "systemd" * "*" get)
.map(f => f -> s"systemd/${f.getName}"),
Compile / unmanagedResourceDirectories += baseDirectory.value / "markdown",
Test / unmanagedSourceDirectories += baseDirectory.value / "test" / "jars",
Test / parallelExecution := false,
Test / fork := false,
Debian / serverLoading := Some(Systemd),
debianPackageDependencies := Seq("java-11-amazon-corretto-jdk:arm64"),
maintainer := "Security Team <[email protected]>",
packageSummary := "Security HQ app.",
packageDescription := """Deb for Security HQ - the Guardian's service to centralise security information for our AWS accounts.""",
Universal / javaOptions ++= Seq(
"-Dpidfile.path=/dev/null",
"-Dconfig.file=/etc/gu/security-hq.conf",
"-J-XX:+UseCompressedOops",
"-J-XX:+UseConcMarkSweepGC",
"-J-XX:NativeMemoryTracking=detail",
"-J-XX:MaxRAMPercentage=50",
"-J-XX:InitialRAMPercentage=50",
"-XX:NewRatio=3",
"-J-XX:MaxMetaspaceSize=300m",
"-J-Xlog:gc*",
s"-J-Xlog:gc:/var/log/${packageName.value}/gc.log"
),
mergeStrategySettings
)
// exclude this key from the linting (unused keys) as it is incorrectly flagged
Global / excludeLintKeys += Universal / topLevelDirectory
lazy val root = (project in file(".")).
aggregate(hq).
settings(
name := """security-hq"""
)
addCommandAlias("dependency-tree", "dependencyTree")