-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #893 from mitch-seymour/patch-3
Fixed SystemVPlugin override start script behavior for debian
- Loading branch information
Showing
17 changed files
with
75 additions
and
2 deletions.
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
25 changes: 25 additions & 0 deletions
25
src/sbt-test/debian/override-start-script-systemd/build.sbt
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,25 @@ | ||
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-startup-script") <<= (target, streams) map { (target, out) => | ||
val extracted = target / "tmp" / "extracted-package" | ||
extracted.mkdirs() | ||
Seq("dpkg-deb", "-R", (target / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).! | ||
|
||
val script = IO.read(extracted / "lib" / "systemd" / "system" / "debian-test.service") | ||
assert(script.startsWith("# right systemd template"), s"override script wasn't picked, script is\n$script") | ||
() | ||
} |
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
src/sbt-test/debian/override-start-script-systemd/src/templates/start
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,2 @@ | ||
# check that old start template isn't picked | ||
# wrong systemd start template |
1 change: 1 addition & 0 deletions
1
src/sbt-test/debian/override-start-script-systemd/src/templates/systemloader/systemd
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 @@ | ||
# right systemd template |
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
src/sbt-test/debian/override-start-script-systemv/build.sbt
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,25 @@ | ||
enablePlugins(JavaServerAppPackaging, JDebPackaging, SystemVPlugin) | ||
|
||
// 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-startup-script") <<= (target, streams) map { (target, out) => | ||
val extracted = target / "tmp" / "extracted-package" | ||
extracted.mkdirs() | ||
Seq("dpkg-deb", "-R", (target / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).! | ||
|
||
val script = IO.read(extracted / "etc" / "init.d" / "debian-test") | ||
assert(script.startsWith("# right systemv template"), s"override script wasn't picked, script is\n$script") | ||
() | ||
} |
3 changes: 3 additions & 0 deletions
3
src/sbt-test/debian/override-start-script-systemv/project/plugins.sbt
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,3 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) | ||
|
||
libraryDependencies += "org.vafer" % "jdeb" % "1.3" artifacts (Artifact("jdeb", "jar", "jar")) |
2 changes: 2 additions & 0 deletions
2
src/sbt-test/debian/override-start-script-systemv/src/templates/start
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,2 @@ | ||
# check that old start template isn't picked | ||
# wrong systemv start template |
1 change: 1 addition & 0 deletions
1
src/sbt-test/debian/override-start-script-systemv/src/templates/systemloader/systemv
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 @@ | ||
# right systemv template |
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,6 @@ | ||
# Run the debian packaging. | ||
> debian:packageBin | ||
$ exists target/debian-test_0.1.0_all.deb | ||
|
||
# Check files for defaults | ||
> check-startup-script |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
src/sbt-test/debian/override-start-script-upstart/project/plugins.sbt
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,3 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) | ||
|
||
libraryDependencies += "org.vafer" % "jdeb" % "1.3" artifacts (Artifact("jdeb", "jar", "jar")) |
File renamed without changes.
File renamed without changes.
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,6 @@ | ||
# Run the debian packaging. | ||
> debian:packageBin | ||
$ exists target/debian-test_0.1.0_all.deb | ||
|
||
# Check files for defaults | ||
> check-startup-script |
1 change: 0 additions & 1 deletion
1
src/sbt-test/debian/override-start-script/src/templates/systemloader/systemv
This file was deleted.
Oops, something went wrong.