An SBT plugin to create then publish .tgz artifacts
In your project/plugins.sbt
file:
resolvers += Resolver.url("hmrc-sbt-plugin-releases",
url("https://dl.bintray.com/hmrc/sbt-plugin-releases"))(Resolver.ivyStylePatterns)
addSbtPlugin("uk.gov.hmrc" % "sbt-distributables" % "x.x.x")
where 'x.x.x' is the latest release as advertised above.
In your project/FrontendBuild.scala
or project/MicroserviceBuild.scala
- Add the line
.enablePlugins(SbtDistributablesPlugin)
to enable artifact creation - Add the line
.settings(SbtDistributablesPlugin.publishingSettings)
to enable artifact publication
Optional settings:
- Add the line
.settings(extraFiles := Seq(new File("<PATH-TO-FILE>")))
to add extra files to the archive (path must be relative)
When enabled sbt-distributables automatically creates and publishes a .tgz artifact. For an artifact tester
with version 1.0.0
this would result in the following:
tester-1.0.0.tgz
.
tester-1.0.0
bin
conf
lib
share
README.md
Procfile
start-docker.sh
system.properties
system.properties
will specify a java.runtime.version
derived from the scalacOptions
setting in SBT.