Debug stack traces in core. Bugfix around directory creating ordering.

This commit is contained in:
Jonathan Bernard 2017-05-11 10:39:38 -05:00
parent a7619a3048
commit 42f37a21e6

View File

@ -82,7 +82,6 @@ proc setupProject(wksp: Workspace) =
raiseEx "Version command (" & wksp.project.versionCmd &
") returned non-zero exit code."
wksp.outputHandler.sendMsg "Building version " & versionResult.output.strip
wksp.version = versionResult.output.strip
wksp.env["VERSION"] = wksp.version
@ -197,10 +196,12 @@ proc runStep*(cfg: StrawBossConfig, req: RunRequest,
version: nil)
except:
when not defined(release): echo getCurrentException().getStackTrace()
result = BuildStatus(state: "failed",
details: getCurrentExceptionMsg())
try: discard emitStatus(result, nil, outputHandler)
except: discard ""
return
try:
# Clone the repo and setup the working environment
@ -208,6 +209,10 @@ proc runStep*(cfg: StrawBossConfig, req: RunRequest,
"cloning project repo and preparing to run '" & req.stepName & "'")
wksp.setupProject()
# Make sure our project directory exists in the artifacts repo
if not existsDir(wksp.artifactsRepo & "/" & wksp.project.name):
createDir(wksp.artifactsRepo & "/" & wksp.project.name)
# Update our cache of project configurations by copying the configuration
# file to our artifacts directory.
copyFile(
@ -261,6 +266,7 @@ proc runStep*(cfg: StrawBossConfig, req: RunRequest,
result = wksp.status
except:
when not defined(release): echo getCurrentException().getStackTrace()
let msg = getCurrentExceptionMsg()
try:
wksp.publishStatus("failed", msg)