alkersan / sbt-package-courier   0.2.0

MIT License GitHub

Plugin to deliver native package to artifact storage

Scala versions: 2.10
sbt plugins: 0.13

sbt-package-courier

Plugin to deliver native packages to artifact storage

Requirements

Setup

Add plugin dependency to project/plugins.sbt:

addSbtPlugin("io.sysa" % "sbt-package-courier" % "0.2.0")

Usage

Deb publishing

Assuming that sbt-native-packager is configured to build deb packages, Artifactory is hosted at https://repo.acme.corp/artifactory and apt repository is called apt-repo, the possible definitions of setting keys can be:

enablePlugins(DebArtifactoryDeployPlugin)
debianArtifactoryUrl in Debian := "https://repo.acme.corp/artifactory"
debianArtifactoryCredentials in Debian := Some(Credentials(Path.userHome / ".ivy2" / ".credentials"))
debianArtifactoryRepo in Debian := "apt-repo"
debianArtifactoryPath in Debian := s"pool/${packageName.value}"
debianArtifactoryDistribution in Debian := Seq("debian", "ubuntu")
debianArtifactoryComponent in Debian := Seq("main")
debianArtifactoryArchitecture in Debian := Seq("i386", "amd64")

publish in Debian := (debianArtifactoryPublish in Debian).value

Credentials are optional, although by default Artifactory requires authentication for publishing.

Multiple values of Distribution, Component, Architecture can be specified, thus Matrix publishing will be performed. By default Architecture is set to native-packager's packageArchitecture.

Then publishing is done with:

> sbt debian:publish

Rpm publishing

Assuming that sbt-native-packager is configured to build rpm packages, Artifactory is hosted at https://repo.acme.corp/artifactory and rpm repository is called rpm-repo possible definitions of setting keys can be:

enablePlugins(RpmArtifactoryDeployPlugin)
rpmArtifactoryUrl in Rpm := "https://repo.acme.corp/artifactory"
rpmArtifactoryCredentials in Rpm := Some(Credentials(Path.userHome / ".ivy2" / ".credentials"))
rpmArtifactoryRepo in Rpm := "rpm-repo"
rpmArtifactoryPath in Rpm := s"pool/${packageName.value}"

publish in Rpm := (rpmArtifactoryPublish in Rpm).value

Be aware that correct nesting in rpmArtifactoryPath is critical for proper work of rpm repo. Read more about repodata depth

Then publishing is done with:

> sbt rpm:publish

Future plans