mirror of
				https://github.com/Telecominfraproject/OpenNetworkLinux.git
				synced 2025-10-31 18:28:15 +00:00 
			
		
		
		
	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:
		| @@ -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) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jeffrey Townsend
					Jeffrey Townsend