forked from TheHive-Project/TheHive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
141 lines (112 loc) · 4.07 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
136
137
138
139
140
141
name := "TheHive"
lazy val thehiveBackend = (project in file("thehive-backend"))
.settings(publish := {})
lazy val thehiveMetrics = (project in file("thehive-metrics"))
.dependsOn(thehiveBackend)
.settings(publish := {})
lazy val thehiveMisp = (project in file("thehive-misp"))
.dependsOn(thehiveBackend)
.settings(publish := {})
lazy val thehiveCortex = (project in file("thehive-cortex"))
.dependsOn(thehiveBackend)
.settings(publish := {})
.settings(SbtScalariform.scalariformSettings: _*)
lazy val main = (project in file("."))
.enablePlugins(PlayScala)
.dependsOn(thehiveBackend, thehiveMetrics, thehiveMisp, thehiveCortex)
.aggregate(thehiveBackend, thehiveMetrics, thehiveMisp, thehiveCortex)
.settings(aggregate in Docker := false)
.settings(PublishToBinTray.settings: _*)
.settings(Release.settings: _*)
releaseVersionUIFile := baseDirectory.value / "ui" / "package.json"
changelogFile := baseDirectory.value / "CHANGELOG.md"
// Front-end //
run := {
(run in Compile).evaluated
frontendDev.value
}
mappings in packageBin in Assets ++= frontendFiles.value
mappings in Universal ~= { _.filterNot {
case (_, name) => name == "conf/application.conf"
}}
// Install files //
mappings in Universal ++= {
val dir = baseDirectory.value / "install"
(dir.***) pair relativeTo(dir.getParentFile)
}
// Release //
import ReleaseTransformations._
import Release._
bintrayOrganization := Some("cert-bdf")
bintrayRepository := "thehive"
publish := {
(publish in Docker).value
PublishToBinTray.publishRelease.value
PublishToBinTray.publishLatest.value
}
releaseProcess := Seq[ReleaseStep](
checkUncommittedChanges,
checkSnapshotDependencies,
getVersionFromBranch,
runTest,
releaseMerge,
checkoutMaster,
setReleaseVersion,
setReleaseUIVersion,
generateChangelog,
commitChanges,
tagRelease,
publishArtifacts,
checkoutDevelop,
setNextVersion,
setNextUIVersion,
commitChanges,
//commitNextVersion,
pushChanges)
// DOCKER //
dockerBaseImage := "elasticsearch:2.3"
dockerExposedVolumes += "/data"
dockerRepository := Some("certbdf")
dockerUpdateLatest := true
mappings in Universal += file("docker/entrypoint") -> "bin/entrypoint"
import com.typesafe.sbt.packager.docker.{ ExecCmd, Cmd }
dockerCommands := dockerCommands.value.map {
case ExecCmd("ENTRYPOINT", _*) => ExecCmd("ENTRYPOINT", "bin/entrypoint")
case cmd => cmd
}
dockerCommands := (dockerCommands.value.head +:
Cmd("EXPOSE", "9000") +:
dockerCommands.value.tail)
// Scalariform //
import scalariform.formatter.preferences._
import com.typesafe.sbt.SbtScalariform
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
ScalariformKeys.preferences in ThisBuild := ScalariformKeys.preferences.value
.setPreference(AlignParameters, false)
// .setPreference(FirstParameterOnNewline, Force)
.setPreference(AlignArguments, true)
// .setPreference(FirstArgumentOnNewline, true)
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(AlignSingleLineCaseStatements.MaxArrowIndent, 60)
.setPreference(CompactControlReadability, true)
.setPreference(CompactStringConcatenation, false)
.setPreference(DoubleIndentClassDeclaration, true)
// .setPreference(DoubleIndentMethodDeclaration, true)
.setPreference(FormatXml, true)
.setPreference(IndentLocalDefs, false)
.setPreference(IndentPackageBlocks, false)
.setPreference(IndentSpaces, 2)
.setPreference(IndentWithTabs, false)
.setPreference(MultilineScaladocCommentsStartOnFirstLine, false)
// .setPreference(NewlineAtEndOfFile, true)
.setPreference(PlaceScaladocAsterisksBeneathSecondAsterisk, false)
.setPreference(PreserveSpaceBeforeArguments, false)
// .setPreference(PreserveDanglingCloseParenthesis, false)
.setPreference(DanglingCloseParenthesis, Prevent)
.setPreference(RewriteArrowSymbols, true)
.setPreference(SpaceBeforeColon, false)
// .setPreference(SpaceBeforeContextColon, false)
.setPreference(SpaceInsideBrackets, false)
.setPreference(SpaceInsideParentheses, false)
.setPreference(SpacesWithinPatternBinders, true)
.setPreference(SpacesAroundMultiImports, true)