implemented 04-build-executor.md incl. concurrency amendment: async builds in per-branch worktrees, builds.maxConcurrent, cancellation, live logs; fix .gitignore build/ rule that silently excluded the de.hoennig.gittally.build package (also recovers the step-01 domain files)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
ae3ae7aa04
commit
b379bc0a6b
@@ -0,0 +1,31 @@
|
||||
package de.hoennig.gittally.build
|
||||
|
||||
import org.springframework.stereotype.Component
|
||||
import java.nio.file.Path
|
||||
|
||||
/**
|
||||
* Starts a single build or clean command and hands the [Process] back to the caller,
|
||||
* which owns log streaming and process-tree termination.
|
||||
* Native shell execution for now; a Docker runner can plug in later (step 11).
|
||||
*/
|
||||
interface BuildRunner {
|
||||
fun start(
|
||||
command: String,
|
||||
workingDir: Path,
|
||||
environment: Map<String, String>,
|
||||
): Process
|
||||
}
|
||||
|
||||
@Component
|
||||
class ProcessBuildRunner : BuildRunner {
|
||||
override fun start(
|
||||
command: String,
|
||||
workingDir: Path,
|
||||
environment: Map<String, String>,
|
||||
): Process {
|
||||
val processBuilder = ProcessBuilder("bash", "-c", command)
|
||||
processBuilder.directory(workingDir.toFile())
|
||||
processBuilder.environment().putAll(environment)
|
||||
return processBuilder.start()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user