-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sbt
100 lines (86 loc) · 3.35 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
import ReleaseTransformations.*
import sbtversionpolicy.withsbtrelease.ReleaseVersion.fromAggregatedAssessedCompatibilityWithLatestRelease
lazy val baseSettings = Seq(
scalaVersion := "2.13.15",
crossScalaVersions := Seq(scalaVersion.value, "3.3.4"),
organization := "com.gu.play-secret-rotation",
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")),
scalacOptions ++= Seq("-deprecation", "-unchecked", "-release:11"),
Test / testOptions +=
Tests.Argument(TestFrameworks.ScalaTest,"-u", s"test-results/scala-${scalaVersion.value}", "-o")
)
val jacksonOverride = "com.fasterxml.jackson.core" % "jackson-core" % "2.18.2"
lazy val core =
project.settings(baseSettings).settings(
libraryDependencies ++= Seq(
"com.github.blemale" %% "scaffeine" % "5.3.0",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.5",
"org.threeten" % "threeten-extra" % "1.8.0",
"org.scalatest" %% "scalatest" % "3.2.19" % Test,
)
)
lazy val `aws-parameterstore-secret-supplier-base` =
project.in(file("aws-parameterstore/secret-supplier")).settings(baseSettings).dependsOn(core)
val awsSdkForVersion = Map(
1 -> "com.amazonaws" % "aws-java-sdk-ssm" % "1.12.780",
2 -> "software.amazon.awssdk" % "ssm" % "2.29.17"
)
def awsParameterStoreWithSdkVersion(version: Int)=
Project(s"aws-parameterstore-sdk-v$version", file(s"aws-parameterstore/secret-supplier/aws-sdk-v$version"))
.settings(baseSettings)
.dependsOn(`aws-parameterstore-secret-supplier-base`)
.settings(libraryDependencies += awsSdkForVersion(version))
lazy val `aws-parameterstore-sdk-v1` = awsParameterStoreWithSdkVersion(1)
lazy val `aws-parameterstore-sdk-v2` = awsParameterStoreWithSdkVersion(2)
lazy val `aws-parameterstore-lambda` = project.in(file("aws-parameterstore/lambda"))
.settings(baseSettings).dependsOn(`secret-generator`).settings(
libraryDependencies ++= Seq(
"com.amazonaws" % "aws-lambda-java-core" % "1.2.3",
"com.amazonaws" % "aws-lambda-java-events" % "3.14.0",
awsSdkForVersion(1),
jacksonOverride,
)
)
lazy val `secret-generator` = project.settings(baseSettings)
val exactPlayVersions = Map(
"29" -> "com.typesafe.play" %% "play" % "2.9.5",
"30" -> "org.playframework" %% "play" % "3.0.6"
)
def playVersion(majorMinorVersion: String)= {
Project(s"play-v$majorMinorVersion", file(s"play/play-v$majorMinorVersion"))
.settings(baseSettings)
.dependsOn(core)
.settings(libraryDependencies ++= Seq(
exactPlayVersions(majorMinorVersion),
jacksonOverride,
))
}
lazy val `play-v29` = playVersion("29")
lazy val `play-v30` = playVersion("30")
lazy val `play-secret-rotation-root` = (project in file("."))
.aggregate(
core,
`play-v29`,
`play-v30`,
`aws-parameterstore-secret-supplier-base`,
`aws-parameterstore-sdk-v1`,
`aws-parameterstore-sdk-v2`,
`secret-generator`,
`aws-parameterstore-lambda`
)
.settings(baseSettings).settings(
publish / skip := true,
releaseVersion := fromAggregatedAssessedCompatibilityWithLatestRelease().value,
releaseCrossBuild := true, // true if you cross-build the project for multiple Scala versions
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
setNextVersion,
commitNextVersion
)
)