-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modifying the start-rpm-template and LinuxPlugin such that where the …
…defaultLinuxLogsLocation is overridden the deamon log will be assigned to this overridden location. This was causing an issue given that the rpm would create the log location at the new location, but the daemon was still logging in the default location which was not created by the rpm. Tested on CENTOS 6.7 Added test coverage for defaultLinuxInstallLocation and defaultLinuxLogsLocation for init.d files generated upon creation of rpm
- Loading branch information
Showing
6 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
enablePlugins(JavaServerAppPackaging) | ||
|
||
name := "rpm-test" | ||
|
||
version := "0.1.0" | ||
|
||
maintainer := "Josh Suereth <joshua.suereth@typesafe.com>" | ||
|
||
packageSummary := "Test rpm package" | ||
|
||
executableScriptName := "rpm-exec" | ||
|
||
packageDescription := """A fun package description of our software, | ||
with multiple lines.""" | ||
|
||
rpmRelease := "1" | ||
|
||
rpmVendor := "typesafe" | ||
|
||
rpmUrl := Some("http://github.com/sbt/sbt-native-packager") | ||
|
||
rpmLicense := Some("BSD") | ||
|
||
defaultLinuxInstallLocation := "/opt/test" | ||
|
||
defaultLinuxLogsLocation := "/opt/test/log" | ||
|
||
TaskKey[Unit]("unzip") <<= (baseDirectory, packageBin in Rpm, streams) map { (baseDir, rpmFile, streams) => | ||
val rpmPath = Seq(rpmFile.getAbsolutePath) | ||
Process("rpm2cpio" , rpmPath) #| Process("cpio -i --make-directories") ! streams.log | ||
() | ||
} | ||
|
||
TaskKey[Unit]("check-init-file") <<= (baseDirectory, streams) map { (target, out) => | ||
val initd = IO.read(target / "etc" / "init.d" / "rpm-test") | ||
assert(initd contains "/opt/test/rpm-test", "defaultLinuxInstallLocation not overriden in init.d\n" + initd) | ||
assert(initd contains "/opt/test/log/rpm-test/rpm-test.log", "defaultLinuxLogsLocation not overriden in init.d\n" + initd) | ||
out.log.success("Successfully tested rpm-test file") | ||
() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) |
10 changes: 10 additions & 0 deletions
10
src/sbt-test/rpm/path-override-rpm/src/main/scala/test/Main.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package test | ||
|
||
object Main { | ||
def main (args: Array[String]) { | ||
//server app imitation | ||
while (true){ | ||
Thread.sleep(1000L) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Run the rpm packaging. | ||
> rpm:package-bin | ||
$ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm | ||
|
||
> unzip | ||
$ exists opt/test/rpm-test | ||
|
||
$ exists etc/init.d/rpm-test | ||
> check-init-file | ||
|