Commit d486bc15 authored by Nong Hoang Tu's avatar Nong Hoang Tu
Browse files

Add debug log for other procs

parent 7079b4ca
Pipeline #2188 canceled with stages
......@@ -36,12 +36,14 @@ proc doUpdateProject(config: ProgConf, project: DebPackage): Err =
]#
var stderr, localVer, serverVer: string
project.log.logDebug(project.name, "Pulling project at " & project.path)
if gbpPull(config.uscanPath, project.path, stderr) != 0:
project.log.logErr(project.name, "Error while pulling", stderr)
return Err.failed
else:
project.log.logInfo(project.name, "Pull completed. Start checking new update")
project.log.logDebug(project.name, "Checking new update at " & project.path)
let updateStt = checkUpdate(config.uscanPath, project.path, localVer, serverVer, stderr)
if updateStt == Err.updated:
project.log.logInfo(project.name, "Up to date")
......@@ -52,24 +54,28 @@ proc doUpdateProject(config: ProgConf, project: DebPackage): Err =
else:
project.log.logInfo(project.name, "[" & localVer & "] [" & serverVer & "]. Start upgrading source code.")
project.log.logDebug(project.name, "Upgrading new version [" & serverVer & "] at " & project.path)
if gbpUpdate(config.uscanPath, project.path, stderr) != 0:
project.log.logErr(project.name, "Error while updating", stderr)
return Err.failed
else:
project.log.logInfo(project.name, "Upgrade to new version successfully. Making changelog.")
project.log.logDebug(project.name, "Creating changelog at " & project.path)
if gbpDch(config.uscanPath, project.path, serverVer, stderr) != 0:
project.log.logErr(project.name, "Error while creating new changelog", stderr)
return Err.failed
else:
project.log.logInfo(project.name, "New changelog was created. Making new tag.")
project.log.logDebug(project.name, "Creating new tags and branches " & project.path)
if gbpTag(config.uscanPath, project.path, stderr) != 0:
project.log.logErr(project.name, "Error while creating new tag", stderr)
return Err.failed
else:
project.log.logInfo(project.name, "Create new tag successfully. Start pushing.")
project.log.logDebug(project.name, "Pushing branches at " & project.path)
if gbpPush(config.uscanPath, project.path, stderr) != 0:
project.log.logErr(project.name, "Error while pushing new patches", stderr)
return Err.failed
......@@ -88,6 +94,7 @@ proc updateProjectAll(config: ProgConf) =
if kind == pcDir:
project.path = path
project.name = path.splitPath.tail
project.log.logDebug(project.name, "Upgrading at " & project.path)
let updateResult = doUpdateProject(config, project)
if updateResult == Err.updated:
resultLog.logInfo(project.name, "Up to date")
......@@ -109,6 +116,7 @@ proc updateProjectArr(config: ProgConf, projectArr: seq[string]) =
if not dirExists(project.path):
resultLog.logErr(project.name, "Dir doesn't exist", "")
else:
project.log.logDebug(project.name, "Upgrading at " & project.path)
let updateResult = doUpdateProject(config, project)
if updateResult == Err.updated:
resultLog.logInfo(project.name, "Up to date")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment