-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
137 lines (120 loc) · 4.22 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
import sbt._
import ReleaseTransformations._
resolvers += Resolver.sonatypeRepo("public")
enablePlugins(DockerPlugin)
name := "rprng"
organization := "com.jejking"
scalaVersion := "2.13.5"
autoAPIMappings := true
scalacOptions := Seq(
"-unchecked",
"-deprecation",
"-encoding", "utf8",
"-feature", "-language:postfixOps",
"-target:11")
libraryDependencies ++= {
val akkaV = "2.6.13"
val akkaHttpV = "10.2.4"
val scalaTestV = "3.2.5"
val commonsMathV = "3.6.1"
val scalaMockV = "5.1.0"
val logbackV = "1.2.3"
Seq(
"org.apache.commons" % "commons-math3" % commonsMathV,
"com.typesafe.akka" %% "akka-actor" % akkaV,
"com.typesafe.akka" %% "akka-slf4j" % akkaV,
"ch.qos.logback" % "logback-classic" % logbackV,
"ch.qos.logback" % "logback-core" % logbackV,
"net.logstash.logback" % "logstash-logback-encoder" % "6.6",
"com.typesafe.akka" %% "akka-stream" % akkaV,
"com.typesafe.akka" %% "akka-http-core" % akkaHttpV,
"com.typesafe.akka" %% "akka-http" % akkaHttpV,
"com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpV,
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpV % "test",
"com.typesafe.akka" %% "akka-stream-testkit" % akkaV % "test",
"org.scalatest" %% "scalatest" % scalaTestV % "test",
"com.typesafe.akka" %% "akka-testkit" % akkaV % "test",
"org.scalamock" %% "scalamock" % scalaMockV % "test"
)
}
test in assembly := {}
mainClass in assembly := Some("com.jejking.rprng.main.Main")
lazy val rprng = (project in file(".")).
enablePlugins(BuildInfoPlugin).
settings(
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoObject := "Info",
buildInfoPackage := "com.jejking.rprng.info"
)
// releasePublishArtifactsAction := PgpKeys.publishSigned.value
publishMavenStyle := true
publishArtifact in Test := false
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
pomIncludeRepository := { _ => false }
// publishTo := Some(Resolver.file("file", new File(Path.userHome.absolutePath+"/.m2/repository")))
pomExtra in Global := (
<url>https://github.com/jejking/rprng</url>
<licenses>
<license>
<name>Apache 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>[email protected]:jejking/rprng.git</url>
<connection>scm:git:[email protected]:jejking/rprng.git</connection>
</scm>
<developers>
<developer>
<id>jejking</id>
<name>John King</name>
<url>http://www.jejking.com</url>
</developer>
</developers>)
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
ReleaseStep(action = Command.process("publishSigned", _)),
setNextVersion,
commitNextVersion,
ReleaseStep(action = Command.process("sonatypeReleaseAll", _)),
pushChanges
)
imageNames in docker := Seq(
// Sets a name with a tag that contains the project version
ImageName(
registry = Some("docker.io"),
namespace = Some("jejking"),
repository = name.value,
tag = Some("v" + version.value)
),
ImageName(
registry = Some("docker.io"),
namespace = Some("jejking"),
repository = name.value,
tag = Some("latest")
)
)
dockerfile in docker := {
// The assembly task generates a fat JAR file
val artifact: File = assembly.value
val artifactTargetPath = s"/app/${artifact.name}"
new Dockerfile {
from("openjdk:alpine")
add(artifact, artifactTargetPath)
entryPoint("java", "-jar", artifactTargetPath)
expose(8080)
}
}