-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sbt
105 lines (89 loc) · 3.5 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
import ReleaseTransformations._
import com.typesafe.sbt.packager.docker.Cmd
name := """api-gateway"""
organization := "com.github.cupenya"
scalaVersion := "2.11.8"
scalacOptions := Seq("-unchecked", "-feature", "-deprecation", "-encoding", "utf8")
credentials += Credentials(Path.userHome / ".sbt" / ".credentials")
resolvers += Resolver.jcenterRepo
libraryDependencies ++= {
val akkaV = "2.4.17"
val akkaHttpV = "10.0.7"
val ficusV = "1.2.4"
val slf4sV = "1.7.10"
val logbackV = "1.1.3"
val k8sSvcDiscoveryV = "0.6"
val specs2V = "3.9.1"
Seq(
"com.typesafe.akka" %% "akka-http" % akkaHttpV,
"com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpV,
"com.typesafe.akka" %% "akka-slf4j" % akkaV,
"org.slf4s" %% "slf4s-api" % slf4sV,
"ch.qos.logback" % "logback-classic" % logbackV,
"com.github.jeroenr" %% "k8s-svc-discovery" % k8sSvcDiscoveryV,
"org.specs2" %% "specs2-core" % specs2V % Test,
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpV % Test,
"com.typesafe.akka" %% "akka-testkit" % akkaV % Test
)
}
val branch = "git rev-parse --abbrev-ref HEAD" !!
val cleanBranch = branch.toLowerCase.replaceAll(".*(cpy-[0-9]+).*", "$1").replaceAll("\\n", "").replaceAll("\\r", "")
// begin docker template settings
enablePlugins(JavaServerAppPackaging)
enablePlugins(DockerPlugin)
val shortCommit = ("git rev-parse --short HEAD" !!).replaceAll("\\n", "").replaceAll("\\r", "")
packageName in Docker := "jeroenrosenberg/" + name.value
version in Docker := shortCommit
dockerBaseImage := "airdock/oracle-jdk:jdk-1.8"
defaultLinuxInstallLocation in Docker := s"/opt/${name.value}" // to have consistent directory for files
dockerRepository := Some("docker.io")
// end docker template settings
Revolver.settings
initialCommands := """|import akka.actor._
|import akka.pattern._
|import akka.util._
|import scala.concurrent._
|import scala.concurrent.duration._""".stripMargin
publishMavenStyle := true
publishArtifact in Test := false
releasePublishArtifactsAction := PgpKeys.publishSigned.value
pomIncludeRepository := { _ => false }
credentials += Credentials(Path.userHome / ".sbt" / ".credentials")
publishTo := {
val nexus = "https://test.cupenya.com/nexus/content/repositories"
Some("snapshots" at nexus + "/snapshots")
}
pomExtra :=
<url>https://github.com/cupenya/api-gateway</url>
<licenses>
<license>
<name>Apache-2.0</name>
<url>http://opensource.org/licenses/Apache-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://github.com/cupenya/api-gateway</url>
<connection>scm:git:[email protected]:cupenya/api-gateway.git</connection>
</scm>
<developers>
<developer>
<id>cupenya</id>
<name>Jeroen Rosenberg</name>
<url>https://github.com/cupenya/</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
)