napperley
01/29/2020, 2:03 AMDominaezzz
01/29/2020, 2:04 AMExec
task.napperley
01/29/2020, 2:08 AMDominaezzz
01/29/2020, 2:11 AMnapperley
01/29/2020, 4:37 AMnapperley
01/29/2020, 4:38 AMnapperley
01/29/2020, 5:59 AMnapperley
01/29/2020, 6:02 AM// ...
kotlin {
val username = properties["username"]
val serverHost = properties["serverHost"]
val serverDestDir = properties["serverDestDir"]
// ...
val compressLinuxX64ReleaseBinary by tasks.creating(Exec::class) {
dependsOn("linkProm_manReleaseExecutableLinuxX64")
val binaryDir = "$buildDir/bin/linuxX64/prom_manReleaseExecutable"
val binaryFile = File("$binaryDir/prom_man.kexe")
if (binaryFile.exists()) binaryFile.copyTo(target = File("$binaryDir/prom_man"), overwrite = true)
commandLine("gzip", "-f", "-9", "$binaryDir/prom_man")
}
val copyLinuxX64ReleaseBinary by tasks.creating(Exec::class) {
dependsOn(compressLinuxX64ReleaseBinary)
val binaryDir = "$buildDir/bin/linuxX64/prom_manReleaseExecutable"
commandLine("scp", "$binaryDir/prom_man.gz", "$username@$serverHost:$serverDestDir")
}
val decompressRemoteLinuxX64ReleaseBinary by tasks.creating(Exec::class) {
dependsOn(copyLinuxX64ReleaseBinary)
commandLine("ssh", "-t", "$username@$serverHost", "gunzip", "-f", "$serverDestDir/prom_man.gz")
}
val alterRemoteLinuxX64ReleaseBinary by tasks.creating(Exec::class) {
dependsOn(decompressRemoteLinuxX64ReleaseBinary)
commandLine("ssh", "-t", "$username@$serverHost", "chmod", "+x", "$serverDestDir/prom_man")
}
tasks.create<Exec>("runRemoteLinuxX64ReleaseBinary") {
dependsOn(alterRemoteLinuxX64ReleaseBinary)
commandLine("ssh", "-t", "$username@$serverHost", "$serverDestDir/prom_man",
"<http://localhost:9090>")
}
}