-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
80 lines (60 loc) · 2.15 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
enablePlugins(GitVersioning)
enablePlugins(DockerPlugin)
enablePlugins(SiteScaladocPlugin)
enablePlugins(PamfletPlugin)
sourceDirectory in Pamflet := sourceDirectory.value / "documentation"
siteSubdirName in SiteScaladoc := "api/latest"
mainClass := Some("com.porpoise.ga.countdown.Main")
assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false)
val repo = "ga"
val username = "aaronp"
name := repo
organization := s"com.github.${username}"
scalaVersion := "2.11.11"
libraryDependencies += "com.google.guava" % "guava" % "22.0"
libraryDependencies += "junit" % "junit" % "4.12" % "test"
// see https://leonard.io/blog/2017/01/an-in-depth-guide-to-deploying-to-maven-central/
pomIncludeRepository := (_ => false)
// To sync with Maven central, you need to supply the following information:
pomExtra in Global := {
<url>https://github.com/{username}/{}</url>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<id>{username}</id>
<name>Aaron Pritzlaff</name>
<url>https://github.com/{username}/{repo}</url>
</developer>
</developers>
}
imageNames in docker := Seq(
ImageName(s"porpoiseltd/${name.value}:latest")
)
dockerfile in docker := {
// The assembly task generates a fat JAR file
val artifact: File = assembly.value
val resDir = (resourceDirectory in Compile).value
val entrypointPath = resDir.toPath.resolve("ga.sh").toFile
val example = resDir.toPath.resolve("simple.example").toFile
//
// see https://forums.docker.com/t/is-it-possible-to-pass-arguments-in-dockerfile/14488
// for passing in args to docker in run (which basically just says to use $@)
//
new Dockerfile {
from("java")
maintainer("Aaron Pritzlaff")
add(artifact, "/ga-app/ga.jar")
add(entrypointPath, "/ga-app/ga.sh")
add(example, "/examples/simple.example")
env("GA_HOME", "/ga-app")
run("chmod", "777", "/ga-app/ga.sh")
workDir("/ga-app")
// entryPoint("java", "-jar", "ga.jar", "$@")
entryPoint("/ga-app/ga.sh")
}
}