-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
87 lines (75 loc) · 2.7 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
import sbt._
import Keys._
import Dependencies._
import Settings._
name := """cqrs-cache"""
version := "1.0"
enablePlugins(sbtdocker.DockerPlugin, UniversalPlugin, JavaServerAppPackaging)
lazy val root = (project in file("."))
.enablePlugins(PlayScala)
.disablePlugins(PlayLayoutPlugin)
.aggregate(application, domain, infrastructure)
.dependsOn(application, domain, infrastructure)
.settings(
libraryDependencies ++= Seq(scalaTest % Test, guice, evolutions, jdbc)
)
.settings(commonSettings)
.settings(routesGenerator := InjectedRoutesGenerator)
lazy val application = (project in file("cqrs-cache/application"))
.enablePlugins(PlayScala, SbtWeb)
.dependsOn(domain)
.settings(commonSettings)
.settings(libraryDependencies ++= Seq(playJson4s, playJson4sTest, filters))
lazy val domain = (project in file("cqrs-cache/domain"))
.enablePlugins(PlayScala)
.disablePlugins(PlayLayoutPlugin)
.dependsOn(infrastructure % "test->test;compile->compile")
.settings(commonSettings)
lazy val infrastructure = (project in file("cqrs-cache/infrastructure"))
.enablePlugins(PlayScala)
.disablePlugins(PlayLayoutPlugin)
.settings(commonSettings)
.settings(libraryDependencies ++= Seq(akkaPersistence, akkaPersistenceTesting, akkaPersistenceJDBC, akkaRemote, akkaTestkit, apacheCommon, postgresql))
.settings(
//use for persistence actor testing
resolvers += "dnvriend" at "http://dl.bintray.com/dnvriend/maven"
)
dockerfile in docker := {
val appDir: File = stage.value
val targetDir = "/app"
new Dockerfile {
from("openjdk:8-jre")
env(("HTTP_PORT", "9000"))
env(("JMX_PORT", "3338"))
env(("JMX_REMOTE_SSL", "false"))
env(("JMX_REMOTE_AUTHENTICATE", "false"))
entryPointRaw(
s"""
| $targetDir/bin/${executableScriptName.value} -Dappname=cqrs-cache-app
|-Dhttp.port=$${HTTP_PORT}
|-Ddb.default.driver=org.postgresql.Driver
|-Dcom.sun.management.jmxremote.port=$${JMX_PORT}
|-Dcom.sun.management.jmxremote.ssl=$${JMX_REMOTE_SSL}
|-Dcom.sun.management.jmxremote.authenticate=$${JMX_REMOTE_AUTHENTICATE}
|-Dlog.dir=./logs
|-J-Xms4g -J-Xmx6g -J-server
|""".stripMargin.replaceAll("\n+", " ")
)
copy(appDir, targetDir)
}
}
imageNames in docker := Seq(
// Sets the latest tag
ImageName(s"${organization.value}/${name.value}:latest"),
// Sets a name with a tag that contains the project version
ImageName(
namespace = Some(organization.value),
repository = name.value,
tag = Some("v" + version.value)
)
)
buildOptions in docker := BuildOptions(
cache = false,
removeIntermediateContainers = BuildOptions.Remove.Always,
pullBaseImage = BuildOptions.Pull.Always
)