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