updated build scripts to sbt 1.0

added service returning a tar archive with all the requested packages
This commit is contained in:
2017-09-24 19:31:02 +02:00
parent bf8b765117
commit 3ba670a52f
4 changed files with 64 additions and 16 deletions

View File

@@ -54,15 +54,17 @@ wildflyURL := "localhost:1234"
val deploy2Wildfly = TaskKey[Unit]("deploy2Wildfly", "Deploy to a wildfly server instance", KeyRanks.ATask)
deploy2Wildfly <<= (packagedArtifact in(Compile, Keys.`package`), wildflyURL, wildflyUsername, wildflyPassword) map
deploy2Wildfly := {
val cmd = s"/opt/wildfly/bin/jboss-cli.sh " +
s"--controller='${wildflyURL.value}' " +
s"--connect --user='${wildflyUsername.value}' " +
s"--password='${wildflyPassword.value}' " +
s"--command=\'deploy ${(packagedArtifact in(Compile, Keys.`package`)).value._2} --force\'"
println(cmd)
sys.process.stringToProcess(cmd).! match
{
case ((art: Artifact, warFile: File), url: String, username: String, password: String) =>
//val warFile = (artifactPath in Keys.`package` in Compile).value//(artifactPath in `package`).value.absolutePath //(packageBin in Compile).value //(artifactPath in (Compile, package)).value
val cmd = s"/opt/wildfly/bin/jboss-cli.sh --controller='${url}' --connect --user='${username}' --password='${password}' --command=\'deploy ${warFile.absolutePath} --force\'"
println(cmd)
sys.process.stringToProcess(cmd).! match
{
case 0 => "OK"
case _ => throw new RuntimeException("Error occurred during deploy")
}
}
case 0 => "OK"
case _ => throw new RuntimeException("Error occurred during deploy")
}
}