Miquel Àngel Román
02/18/2022, 5:11 PMplugins {
id("org.hidetake.ssh")
}
remotes {
create("raspberry") {
host = "192.168.1.36"
user = "pi"
password = "doesntmatter"
}
}
But when I start declaring the gradle task all falls apart:
tasks.register("deploy-to-pi") {
doLast{
ssh.run {
session(remotes["raspberry"]) {
}
}
}
}
With:
Unresolved reference: session
Vampire
02/19/2022, 12:07 AMrun
function, not the one from that plugin. That plugin is written very Groovy-specific, so you need some ugliness unless you request from the author a nicer Kotlin compatibility. I think this should work:
tasks.register("deploy-to-pi") {
doLast{
ssh.run(delegateClosureOf<RunHandler> {
session(remotes["raspberry"], delegateClosureOf<SessionHandler> {
})
})
}
}
Miquel Àngel Román
02/19/2022, 11:14 PMMiquel Àngel Román
03/25/2022, 2:26 PMtasks.register<Exec>("deploy-geckos") {
group ="build"
dependsOn("packageDeb")
val fileToSend = "$buildDir/libs/desktop-jvm-1.0.0.jar"
commandLine("sshpass", "-p", "pass", "scp", fileToSend, "user@host://home/pi/Desktop")
}
Miquel Àngel Román
03/25/2022, 2:26 PMVampire
03/25/2022, 3:49 PMrun
method execution? confusedMiquel Àngel Román
03/25/2022, 5:19 PMVampire
03/25/2022, 5:20 PM