feat(deploy): stream live build logs in build progress modal
Show real-time kaniko/init-container build output inside the build progress modal during the building/deploying phases, alongside the existing percentage. The build-logs endpoint now returns live pod logs while a build is in progress (falling back to the persisted log once finished), and the modal polls it every 2s with auto-scroll. Minimize behaviour is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1727,6 +1727,24 @@ CMD ["sh", "-c", "DLL=$(find . -maxdepth 1 -name '*.dll' ! -name '*.deps.dll' !
|
||||
throw new Error(`Build job ${jobName} timed out after ${timeoutSeconds}s\nLogs:\n${logs}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Live build logs for an in-progress build, read straight from the running
|
||||
* build pod (init + kaniko containers). Returns null when there is no active
|
||||
* build session for this deployment (e.g. build already finished/cleaned up),
|
||||
* so callers can fall back to the persisted build log.
|
||||
*/
|
||||
async getLiveBuildLog(deploymentId: string): Promise<string | null> {
|
||||
const session = this.activeBuilds.get(deploymentId);
|
||||
if (!session?.coreApi || !session.namespace || !session.buildPodName) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return await this.getBuildLogs(session.coreApi, session.buildPodName, session.namespace);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private async getBuildLogs(coreApi: k8s.CoreV1Api, jobName: string, namespace: string): Promise<string> {
|
||||
try {
|
||||
const pods = await coreApi.listNamespacedPod({
|
||||
|
||||
Reference in New Issue
Block a user