timetotrade / sbt-backup   1.0.0

Apache License 2.0 GitHub

An sbt plugin to compress and scp a provided directory to some remote host

Scala versions: 2.10
sbt plugins: 0.13

sbt-backup

Build Status Maven Central

This is a simple SBT AutoPlugin that uses scala-ssh and [Apache Commons Compress] (http://commons.apache.org/proper/commons-compress/) to compress and scp a provided directory to some remote host.

The plugin gives you the task backup which can be inserted into your build process as needed

It could be used to backup test results, documentation or any other supplementary material generated during packaging.

Usage

Add to your project/plugins.sbt

addSbtPlugin("com.sensatus" % "sbt-backup" % "1.0.0")

And enable in your project/Build.scala

.enablePlugins(SbtBackup)

The following keys are used for configuration:

Key Type Description Default value
backupHostname Option[String] hostname to connect to None
backupPort Int which port on remote host to connect to 22
backupKeyFile Option[File] key file to use to authenticate None
backupUsername String username to connect as System.getProperty("user.name")
backupSourceDir Option[File] which directory to compress and transfer None
backupRemoteDir File remote directory in which to put the file file(".")

if backupKeyFile is not provided, it will attempt to use any keys it can find in ~/.ssh/

backupSourceDir is a taskKey rather than a settings key so that the 'input' to this task can depend on the output of some other task. For example:

backupSourceDir := (unidoc in Compile).value.headOption

Details

scala-ssh relies on [sshj](https://github .com/shikhar/sshj) for the underlying transport, therefore this only supports the protocols that are supported by sshj

Currently only tar.gz compression is used and the use of ssh-key based authentication is hard coded