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 #745 from timcharper/master
SystemD services now source /etc/default/{{app_name}} (resolves #737)
- Loading branch information
Showing
14 changed files
with
166 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ project/project | |
log/ | ||
target/ | ||
.cache | ||
.ensime* |
29 changes: 29 additions & 0 deletions
29
src/main/resources/com/typesafe/sbt/packager/archetypes/etc-default-systemd-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,29 @@ | ||
# ##################################### | ||
# ##### Environment Configuration ##### | ||
# ##################################### | ||
|
||
# This file is parsed by systemd. You can modify it to specify environment | ||
# variables for your application. | ||
# | ||
# For a description of the format, see: `man systemd.exec`, section | ||
# `EnvironmentFile`. | ||
|
||
# Available replacements | ||
# ------------------------------------------------ | ||
# ${{author}} debian author | ||
# ${{descr}} debian package description | ||
# ${{exec}} startup script name | ||
# ${{chdir}} app directory | ||
# ${{retries}} retries for startup | ||
# ${{retryTimeout}} retry timeout | ||
# ${{app_name}} normalized app name | ||
# ${{daemon_user}} daemon user | ||
# ------------------------------------------------- | ||
|
||
# Setting JAVA_OPTS | ||
# ----------------- | ||
# JAVA_OPTS="-Dpidfile.path=/var/run/${{app_name}}/play.pid" | ||
|
||
# Setting PIDFILE | ||
# --------------- | ||
# PIDFILE="/var/run/${{app_name}}/play.pid" |
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
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-etc-default") <<= (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" / "default" / "debian-test") | ||
assert(script.startsWith("# right etc-default template"), s"etc-default script wasn't picked, contents instead are:\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,3 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) | ||
|
||
libraryDependencies += "org.vafer" % "jdeb" % "1.3" artifacts (Artifact("jdeb", "jar", "jar")) |
1 change: 1 addition & 0 deletions
1
src/sbt-test/debian/override-etc-default/src/templates/etc-default
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 etc-default 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-etc-default |
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
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