gradle-ssh-plugin icon indicating copy to clipboard operation
gradle-ssh-plugin copied to clipboard

Remote script execution

Open int128 opened this issue 11 years ago • 0 comments

Executing Groovy script on the remote host.

task executeScript(type: SshTask) {
  session(remotes.server) {
    executeScript groovy: """
      // here will be executed on the remote host
      println System.properties['user.name']
    """
  }
}

Also giving dependencies:

dependencies {
  remoteRuntime 'org.codehaus.groovy:groovy-all:2.3.0'
}

task executeScript(type: SshTask) {
  session(remotes.server) {
    executeScript classpath: dependencies.remoteRuntime, groovy: """
      // here will be executed on the remote host
      println System.properties['user.name']
    """
  }
}
}

TODO:

  • What is default groovy dependencies? Bundled one with Gradle?

int128 avatar Apr 10 '14 14:04 int128