diff --git a/buildSrc/plugins/src/main/kotlin/org/jetbrains/kotlin/ExecutorService.kt b/buildSrc/plugins/src/main/kotlin/org/jetbrains/kotlin/ExecutorService.kt index 9f13141675c..d7efb99d17e 100644 --- a/buildSrc/plugins/src/main/kotlin/org/jetbrains/kotlin/ExecutorService.kt +++ b/buildSrc/plugins/src/main/kotlin/org/jetbrains/kotlin/ExecutorService.kt @@ -173,6 +173,7 @@ private fun sshExecutor(project: Project) : ExecutorService = object : ExecutorS private val remote: String = project.property("remote").toString() private val sshArgs: List = System.getenv("SSH_ARGS")?.split(" ") ?: emptyList() + private val sshHome = System.getenv("SSH_HOME") ?: "/usr/bin" // Unique remote dir name to be used in the target host private val remoteDir = run { @@ -191,7 +192,7 @@ private fun sshExecutor(project: Project) : ExecutorService = object : ExecutorS upload(executable) executable = "$remoteDir/${File(executable).name}" execFile = executable - commandLine = arrayListOf("/usr/bin/ssh") + sshArgs + remote + commandLine + commandLine = arrayListOf("$sshHome/ssh") + sshArgs + remote + commandLine } } cleanup(execFile!!) @@ -200,19 +201,19 @@ private fun sshExecutor(project: Project) : ExecutorService = object : ExecutorS private fun createRemoteDir() { project.exec { - it.commandLine = arrayListOf("/usr/bin/ssh") + sshArgs + remote + "mkdir" + "-p" + remoteDir + it.commandLine = arrayListOf("$sshHome/ssh") + sshArgs + remote + "mkdir" + "-p" + remoteDir } } private fun upload(fileName: String) { project.exec { - it.commandLine = arrayListOf("/usr/bin/scp") + sshArgs + fileName + "$remote:$remoteDir" + it.commandLine = arrayListOf("$sshHome/scp") + sshArgs + fileName + "$remote:$remoteDir" } } private fun cleanup(fileName: String) { project.exec { - it.commandLine = arrayListOf("/usr/bin/ssh") + sshArgs + remote + "rm" + fileName + it.commandLine = arrayListOf("$sshHome/ssh") + sshArgs + remote + "rm" + fileName } } }