Skip to content

Commit

Permalink
assembly settings, cli.sh, Docker settings pulled out from Scorex(and…
Browse files Browse the repository at this point in the history
… commented out dut to conflict with sbt-native-packager)
  • Loading branch information
kushti committed Mar 27, 2016
1 parent 93f87e9 commit 959e009
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ libraryDependencies ++= Seq(
"org.consensusresearch" %% "scorex-transaction" % "1.2.+"
)

//assembly settings
assemblyJarName in assembly := "lagonaki.jar"

test in assembly := {}

mainClass in assembly := Some("scorex.perma.Application")
3 changes: 3 additions & 0 deletions cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

java -cp target/scala-2.11/lagonaki.jar scorex.api.client.ApiClient
41 changes: 41 additions & 0 deletions docker.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
// dockerize
enablePlugins(DockerPlugin)
// Make the docker task depend on the assembly task,
// which generates a fat JAR file
docker <<= docker.dependsOn(sbt.Keys.`package`.in(Compile, packageBin))
dockerfile in docker := {
val jarFile = (assemblyOutputPath in assembly).value
val jarTargetPath = s"/app/${jarFile.name}"
val settingsPath = (baseDirectory in ThisBuild).value / "settings.json"
new Dockerfile {
from("frolvlad/alpine-oraclejdk8")
// runRaw("apk --update add openjdk7-jre")
// copy compiled jar into the container
run("mkdir", "-p", "/app")
copy(jarFile, jarTargetPath)
// copy settings
copy(settingsPath, "/app/settings.json")
// persist data beyond the lifetime of a container session
run("mkdir", "-p", "/tmp/scorex")
volume("/tmp/scorex")
// run scorex as:
// /usr/bin/java -jar scorex.jar
workDir("/app")
run("/usr/bin/java", "-jar", jarTargetPath)
}
}
// todo: name image
imageNames in docker := Seq(
ImageName(s"org.consensusresearch/starter")
)
// todo: can drop cache
// buildOptions in docker := BuildOptions(cache = false)
*/

0 comments on commit 959e009

Please sign in to comment.