Skip to content

strdio/sbt-ssh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sbt-ssh

Ssh client for sbt which integrates for JASSH (https://github.com/dacr/jassh)

Download

Installation

This plugin uses JASSH v0.10.0+ and requires at least Java 8.

Add the following to your project/plugins.sbt file:

addSbtPlugin("io.strd.build" % "sbt-ssh" % "0.1.0")

Usage

sshOptions := sshOptions.value.copy(
  host = "example.com",
  username = "me")
  
customTask := {
  val session = sshSession.value
  
  session.withSsh { ssh =>
    ssh.shell { shell =>
      import shell._
      put("test", "/tmp/ssh.test")
      val res = get("/tmp/ssh.test")
      rm("/tmp/ssh.test")
      res.exists(_ == "test")
    }
  }
}

Please read the JASSH documentation for an additional information.