-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
79 lines (71 loc) · 2.66 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
import Dependencies._
ThisBuild / scalaVersion := "2.12.11"
ThisBuild / version := "0.5.0"
ThisBuild / organization := "lambda"
ThisBuild / organizationName := "Lambda Town"
ThisBuild / fork := true
ThisBuild / githubOwner := "lambda-town"
ThisBuild / resolvers += Resolver.githubPackages("lambda-town")
ThisBuild / githubRepository := "scala-runner"
lazy val root = (project in file("."))
.settings(
name := "scala-runner",
libraryDependencies += scalaTest % Test,
githubTokenSource := TokenSource.GitConfig("github.token") || TokenSource.Environment("GITHUB_TOKEN")
)
.dependsOn(server, client, scalaUtils)
lazy val server = (project in file("server"))
.settings(
name := "scala-runner-server",
libraryDependencies ++= PureConfig.all ++ Circe.all ++ Fs2.all ++ Log.all ++ Coursier.all ++ Scala.all ++ Seq(
programExecutor,
commonsIO
),
githubTokenSource := TokenSource.GitConfig("github.token") || TokenSource.Environment("GITHUB_TOKEN"),
dockerfile in docker := {
val v = (ThisBuild / scalaVersion).value
new Dockerfile {
from("azul/zulu-openjdk-alpine:13")
expose(2003)
workDir("/app")
// Create Class Data Archive
run("java", "-Xshare:dump")
add((assembly in scalaUtils).value, "./dependencies/utils.jar")
add(assembly.value, "./server.jar")
entryPoint(
"java",
"-Dconfig.resource=application-prod.conf",
"-Xms92m",
"-Xmx92m",
"-XX:+CrashOnOutOfMemoryError",
"-jar",
"./server.jar"
)
}
},
imageNames in docker := Seq(version.value, "latest").map(version =>
ImageName(s"rg.fr-par.scw.cloud/lambda/${name.value}:$version")
),
).dependsOn(messages).enablePlugins(DockerPlugin)
lazy val client = (project in file("client"))
.settings(
name := "scala-runner-client",
libraryDependencies ++= PureConfig.all ++ Circe.all ++ Log.all ++ Fs2.all :+ commonsIO,
githubTokenSource := TokenSource.GitConfig("github.token") || TokenSource.Environment("GITHUB_TOKEN")
).dependsOn(messages)
lazy val messages = (project in file("messages"))
.settings(
name := "scala-runner-messages",
libraryDependencies ++= Circe.all :+ programExecutor,
githubTokenSource := TokenSource.GitConfig("github.token") || TokenSource.Environment("GITHUB_TOKEN")
)
lazy val scalaUtils = (project in file("utils"))
.settings(
name := "scala-utils",
libraryDependencies ++= Seq(
scalaTest % Test,
pprint
),
assemblyJarName in assembly := "utils.jar",
githubTokenSource := TokenSource.GitConfig("github.token") || TokenSource.Environment("GITHUB_TOKEN")
)