Search code examples
sbtsbt-native-packager

Sign and publish debian package


I'm trying to build a debian package, sign it and publish it using the sbt-native-packager.

Is there example of how to sign debian package with GPG id ?

Here is what I did until now :

name := """play-scala-app-name"""

lazy val root = (project in file(".")).enablePlugins(PlayScala, DebianPlugin)

scalaVersion := "2.11.7"

libraryDependencies ++= Seq(
  jdbc,
  cache,
  ws,
  "org.scalatestplus.play" %% "scalatestplus-play" % "1.5.0-RC1" % Test,
  "org.mockito" % "mockito-core" % "1.10.19"
)

resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases"

name in Debian := "app-name"

version in Debian := "1.0"

maintainer in Debian := "maintainer name <maintainer@mail.com>"

packageSummary := "app summary"

packageDescription := """app description"""

publishTo := Some("Debian repo" at "https://repo")

credentials += Credentials("Debian repo Manager", "my.artifact.repo.net", "admin", "admin123")

// how to add code to sign the package ?

Then I will launch sbt clean debian:packageBin debian:publish ?


Solution

  • Native-packager provides a way to call the dpkg-sig command to a sign a package. This command should do the trick

    sbt debianSign
    

    You need dpkg-sig installed.