-
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.
Merge pull request #701 from kardapoltsev/wip/override-start-script
Different start script replacements for different system loaders
- Loading branch information
Showing
9 changed files
with
83 additions
and
20 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
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,35 @@ | ||
import com.typesafe.sbt.packager.archetypes.ServerLoader | ||
|
||
enablePlugins(JavaServerAppPackaging, JDebPackaging) | ||
|
||
serverLoading in Debian := ServerLoader.Upstart | ||
|
||
// TODO change this after #437 is fixed | ||
daemonUser in Linux := "root" | ||
|
||
daemonGroup in Linux := "app-group" | ||
|
||
mainClass in Compile := Some("empty") | ||
|
||
name := "debian-test" | ||
|
||
name in Debian := "debian-test" | ||
|
||
version := "0.1.0" | ||
|
||
maintainer := "Josh Suereth <joshua.suereth@typesafe.com>" | ||
|
||
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" / "debian-test.conf") | ||
assert(script.startsWith("# right upstart template"), s"override script wasn't picked, script is\n$script") | ||
() | ||
} |
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")) |
1 change: 1 addition & 0 deletions
1
src/sbt-test/debian/override-start-script/src/templates/debian/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 |
1 change: 1 addition & 0 deletions
1
src/sbt-test/debian/override-start-script/src/templates/debian/upstart
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 upstart template |
2 changes: 2 additions & 0 deletions
2
src/sbt-test/debian/override-start-script/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 upstart start 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 |
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