Include the version being built in BuildStatus objects.
This commit is contained in:
parent
ce7d4b60de
commit
0574f0ec6a
@ -79,7 +79,10 @@ proc publishStatus(wksp: Workspace, state: BuildState, details: string): void =
|
|||||||
## Update the status for a Workspace and publish this status to the
|
## Update the status for a Workspace and publish this status to the
|
||||||
## Workspace's status file and any output message handlers.
|
## Workspace's status file and any output message handlers.
|
||||||
wksp.status = BuildStatus(
|
wksp.status = BuildStatus(
|
||||||
runId: $wksp.runRequest.runId, state: state, details: details)
|
runId: $wksp.runRequest.runId,
|
||||||
|
state: state,
|
||||||
|
details: details,
|
||||||
|
version: wksp.version)
|
||||||
|
|
||||||
# Write to our run directory, and to our version status
|
# Write to our run directory, and to our version status
|
||||||
writeFile(wksp.buildDataDir / "runs" /
|
writeFile(wksp.buildDataDir / "runs" /
|
||||||
@ -426,7 +429,8 @@ proc run*(cfg: StrawBossConfig, req: RunRequest,
|
|||||||
result = BuildStatus(
|
result = BuildStatus(
|
||||||
runId: $req.runId,
|
runId: $req.runId,
|
||||||
state: BuildState.setup,
|
state: BuildState.setup,
|
||||||
details: "initializing build workspace")
|
details: "initializing build workspace",
|
||||||
|
version: "")
|
||||||
outputHandler.sendStatusMsg(result)
|
outputHandler.sendStatusMsg(result)
|
||||||
|
|
||||||
var wksp: Workspace
|
var wksp: Workspace
|
||||||
@ -476,7 +480,7 @@ proc run*(cfg: StrawBossConfig, req: RunRequest,
|
|||||||
except:
|
except:
|
||||||
when not defined(release): echo getCurrentException().getStackTrace()
|
when not defined(release): echo getCurrentException().getStackTrace()
|
||||||
result = BuildStatus(runId: $req.runId, state: BuildState.failed,
|
result = BuildStatus(runId: $req.runId, state: BuildState.failed,
|
||||||
details: getCurrentExceptionMsg())
|
details: getCurrentExceptionMsg(), version: "")
|
||||||
try: outputHandler.sendStatusMsg(result)
|
try: outputHandler.sendStatusMsg(result)
|
||||||
except: discard ""
|
except: discard ""
|
||||||
return
|
return
|
||||||
@ -514,7 +518,8 @@ proc run*(cfg: StrawBossConfig, req: RunRequest,
|
|||||||
wksp.publishStatus(BuildState.failed, msg)
|
wksp.publishStatus(BuildState.failed, msg)
|
||||||
result = wksp.status
|
result = wksp.status
|
||||||
except:
|
except:
|
||||||
result = BuildStatus(runId: $req.runId, state: BuildState.failed, details: msg)
|
result = BuildStatus(runId: $req.runId, state: BuildState.failed,
|
||||||
|
details: msg, version: "")
|
||||||
try: outputHandler.sendStatusMsg(result)
|
try: outputHandler.sendStatusMsg(result)
|
||||||
except: discard ""
|
except: discard ""
|
||||||
|
|
||||||
@ -545,7 +550,8 @@ proc spawnWorker*(cfg: StrawBossConfig, req: RunRequest):
|
|||||||
let queuedStatus = BuildStatus(
|
let queuedStatus = BuildStatus(
|
||||||
runId: $req.runId,
|
runId: $req.runId,
|
||||||
state: BuildState.queued,
|
state: BuildState.queued,
|
||||||
details: "request queued for execution")
|
details: "request queued for execution",
|
||||||
|
version: "")
|
||||||
writeFile(statusFile, $queuedStatus)
|
writeFile(statusFile, $queuedStatus)
|
||||||
|
|
||||||
var args = @["run", reqFile, "-c", cfg.filePath]
|
var args = @["run", reqFile, "-c", cfg.filePath]
|
||||||
@ -562,6 +568,7 @@ proc spawnWorker*(cfg: StrawBossConfig, req: RunRequest):
|
|||||||
let exMsg = "run request rejected: " & getCurrentExceptionMsg()
|
let exMsg = "run request rejected: " & getCurrentExceptionMsg()
|
||||||
try:
|
try:
|
||||||
writeFile(statusFile,
|
writeFile(statusFile,
|
||||||
$(BuildStatus(runId: $req.runId, state: BuildState.rejected, details: exMsg)))
|
$(BuildStatus(runId: $req.runId, state: BuildState.rejected,
|
||||||
|
details: exMsg, version: "")))
|
||||||
except: discard ""
|
except: discard ""
|
||||||
raiseEx exMsg
|
raiseEx exMsg
|
||||||
|
Loading…
x
Reference in New Issue
Block a user