@@ -41,6 +41,8 @@ class CiRunner(private val config: CiConfig) {
|
||||
private fun ciMain() {
|
||||
config.updateState("pending", "Building project")
|
||||
|
||||
runCommand("pwd", "Could not get working directory", config.wdir)
|
||||
|
||||
val ciConfig = config.getCiConfig()
|
||||
val freshClone = !File(config.wdir).exists()
|
||||
|
||||
@@ -122,10 +124,15 @@ class CiRunner(private val config: CiConfig) {
|
||||
|
||||
val processBuilder = ProcessBuilder("/bin/bash", "-c", command)
|
||||
.directory(File(workingDir))
|
||||
.inheritIO()
|
||||
.redirectErrorStream(true)
|
||||
|
||||
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