versionmanagment

This commit is contained in:
habi
2022-04-06 14:28:43 +05:00
parent bcdb0ac595
commit ac88e7f2cb
3 changed files with 53 additions and 24 deletions

View File

@@ -110,9 +110,25 @@ def versionManagment(request):
currentVersion = VERSION
currentBuild = str(BUILD)
u = "https://api.github.com/repos/usmannasir/cyberpanel/commits?sha=v%s.%s" % (latestVersion, latestBuild)
logging.CyberCPLogFileWriter.writeToFile(u)
r = requests.get(u)
latestcomit = r.json()[0]['sha']
command ="git -C /usr/local/CyberCP/ rev-parse HEAD"
output = ProcessUtilities.outputExecutioner(command)
Currentcomt = output.rstrip("\n")
notechk = True;
if(Currentcomt == latestcomit):
notechk = False;
template = 'baseTemplate/versionManagment.html'
finalData = {'build': currentBuild, 'currentVersion': currentVersion, 'latestVersion': latestVersion,
'latestBuild': latestBuild}
'latestBuild': latestBuild, 'latestcomit': latestcomit, "Currentcomt": Currentcomt, "Notecheck" : notechk }
proc = httpProc(request, template, finalData, 'versionManagement')
return proc.render()