@@ -46,7 +46,7 @@ class CiRunner(private val config: CiConfig) {
|
|||||||
|
|
||||||
if (freshClone) {
|
if (freshClone) {
|
||||||
File(config.udir).mkdirs()
|
File(config.udir).mkdirs()
|
||||||
runCommand("git clone -n ${config.repopath}", "Could not clone repository", config.udir)
|
runCommand("git clone -n ${config.repopath} ${config.repo}", "Could not clone repository", config.udir)
|
||||||
} else {
|
} else {
|
||||||
runCommand("git fetch", "Could not fetch updates", config.wdir)
|
runCommand("git fetch", "Could not fetch updates", config.wdir)
|
||||||
}
|
}
|
||||||
@@ -120,17 +120,12 @@ class CiRunner(private val config: CiConfig) {
|
|||||||
private fun runCommand(command: String, errorMessage: String, workingDir: String) {
|
private fun runCommand(command: String, errorMessage: String, workingDir: String) {
|
||||||
log("Running: $command")
|
log("Running: $command")
|
||||||
|
|
||||||
val processBuilder = ProcessBuilder("/bin/sh", "-c", command)
|
val processBuilder = ProcessBuilder("/bin/bash", "-c", command)
|
||||||
.directory(File(workingDir))
|
.directory(File(workingDir))
|
||||||
.redirectErrorStream(true)
|
.inheritIO()
|
||||||
|
|
||||||
val process = processBuilder.start()
|
val process = processBuilder.start()
|
||||||
|
|
||||||
// Read and log output
|
|
||||||
process.inputStream.bufferedReader().forEachLine { line ->
|
|
||||||
log(line)
|
|
||||||
}
|
|
||||||
|
|
||||||
val exitCode = process.waitFor()
|
val exitCode = process.waitFor()
|
||||||
if (exitCode != 0) {
|
if (exitCode != 0) {
|
||||||
log("Running in $workingDir")
|
log("Running in $workingDir")
|
||||||
|
|||||||
Reference in New Issue
Block a user