Update default versioning scheme for development and release builds.

- Development builds will be marked with the branch and build id.
- Release builds will contain the specific release name and
  a simplified system issue string.
This commit is contained in:
Jeffrey Townsend
2018-03-14 16:14:12 +00:00
parent 2b48832600
commit 0b6da573ab

View File

@@ -1,12 +1,24 @@
import subprocess
class OnlVersionImplementation(object): class OnlVersionImplementation(object):
PRODUCTS = [ PRODUCTS = [
{ {
"id" : "ONL", "id" : "ONL",
"version": "2.0.0" # "version": "20YY-MM"
} }
] ]
def __init__(self):
if 'version' in self.PRODUCTS[0]:
# Release builds have a specific version.
self.release = True
else:
# The current branch is used as the release version.
self.release = False
cmd = ('git', 'rev-parse', '--abbrev-ref', 'HEAD')
branch = subprocess.check_output(cmd).strip()
self.PRODUCTS[0]['version'] = branch
def V_OS_NAME(self, data): def V_OS_NAME(self, data):
return "Open Network Linux OS" return "Open Network Linux OS"
@@ -55,3 +67,9 @@ class OnlVersionImplementation(object):
def V_SYSTEM_COMPATIBILITY_VERSION(self, data): def V_SYSTEM_COMPATIBILITY_VERSION(self, data):
return "2" return "2"
def V_ISSUE(self, data):
if self.release:
return "%s %s" % (self.V_OS_NAME(data), self.V_VERSION_ID(data))
else:
return self.V_VERSION_STRING(data)