-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow custom templates to be provided separately for each template #938
Changes from all commits
ffae52f
8af0b78
397fab7
b18b635
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
enablePlugins(JavaServerAppPackaging, JDebPackaging, SystemdPlugin) | ||
|
||
// TODO change this after #437 is fixed | ||
daemonUser in Linux := "root" | ||
daemonGroup in Linux := "app-group" | ||
|
||
mainClass in Compile := Some("empty") | ||
|
||
name := "debian-test" | ||
version := "0.1.0" | ||
maintainer := "Mitch Seymour <[email protected]>" | ||
|
||
packageSummary := "Test debian package" | ||
packageDescription := """A fun package description of our software, | ||
with multiple lines.""" | ||
|
||
TaskKey[Unit]("check-loader-functions") <<= (target, streams) map { (target, out) => | ||
val extracted = target / "tmp" / "extracted-package" | ||
extracted.mkdirs() | ||
Seq("dpkg-deb", "-e", (target / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).! | ||
|
||
val script = IO.read(extracted / "postinst") | ||
|
||
assert(script.contains("# right systemd template"), s"override script wasn't picked, script is\n$script") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This checks that the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added such an assertion |
||
assert(!script.contains("wrong systemd start template"), s"script contained wrong template, script is\n$script") | ||
() | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) | ||
|
||
libraryDependencies += "org.vafer" % "jdeb" % "1.3" artifacts (Artifact("jdeb", "jar", "jar")) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# check that old start template isn't picked | ||
# wrong systemd start template |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Run the debian packaging. | ||
> debian:packageBin | ||
$ exists target/debian-test_0.1.0_all.deb | ||
|
||
# Check files for defaults | ||
> check-loader-functions |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
enablePlugins(JavaServerAppPackaging, SystemdPlugin) | ||
|
||
name := "rpm-test" | ||
|
||
version := "0.1.0" | ||
|
||
maintainer := "Mitch Seymour <[email protected]>" | ||
|
||
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") | ||
|
||
rpmGroup := Some("test-group") | ||
|
||
TaskKey[Unit]("check-loader-script") <<= (target, streams) map { (target, out) => | ||
val path = target / "rpm"/ "RPMS" / "noarch" / "rpm-test-0.1.0-1.noarch.rpm" | ||
val scripts = s"rpm -qp --scripts ${path.absolutePath}".!! | ||
|
||
assert(scripts.contains("# right systemd template"), s"override script wasn't picked, scripts are\n$scripts") | ||
assert(!scripts.contains("wrong start template"), s"scripts contained wrong template, scripts are\n$scripts") | ||
() | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# check that old start template isn't picked | ||
# wrong start template |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# right systemd template |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Run the rpm packaging. | ||
> rpm:package-bin | ||
$ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm | ||
|
||
> check-loader-script |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# right systemd template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this. This quite some bug. Along with 6 tests that tested the wrong implementation: