@@ -46,7 +46,7 @@ class CiRunner(private val config: CiConfig) {
|
||||
|
||||
if (freshClone) {
|
||||
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 {
|
||||
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) {
|
||||
log("Running: $command")
|
||||
|
||||
val processBuilder = ProcessBuilder("/bin/sh", "-c", command)
|
||||
val processBuilder = ProcessBuilder("/bin/bash", "-c", command)
|
||||
.directory(File(workingDir))
|
||||
.redirectErrorStream(true)
|
||||
.inheritIO()
|
||||
|
||||
val process = processBuilder.start()
|
||||
|
||||
// Read and log output
|
||||
process.inputStream.bufferedReader().forEachLine { line ->
|
||||
log(line)
|
||||
}
|
||||
|
||||
val exitCode = process.waitFor()
|
||||
if (exitCode != 0) {
|
||||
log("Running in $workingDir")
|
||||
|
||||
Reference in New Issue
Block a user