if __name__ == '__main__':
logger.debug('running with this enviroment: %s', os.environ)
atexit.register(remove_git_target_workspace)
- kernel_revision_obj = kernel_persistence.get_last_kernel_revision_obj()
+ kernel_revision_obj = kernel_persistence.get_last_kernel_revision_obj(GIT_BRANCH_NAME)
new_version = kernel_revision_obj.last_version + 1
if not kernel_persistence.update_kernel_revision_obj(kernel_revision_obj, new_version):
logger.info(
last_version = Column(Integer, nullable=False)
pb_modules = Column(String(255), unique=True, nullable=False)
- def __init__(self, branch_name, last_version):
+ def __init__(self, identifier, last_version, branch_name, pb_modules):
self.identifier = identifier
self.last_version = last_version
self.branch_name = branch_name
self.identifier, self.last_version
)
-def get_last_kernel_revision_obj():
+def get_last_kernel_revision_obj(branch):
session = Session()
logger.debug('Getting kernel revision from persistence')
- if GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME.startswith('hotfix'):
+ if branch == 'master' or branch.startswith('hotfix'):
persistence_identifier = 'master'
- elif GIT_BRANCH_NAME.startswith('release'):
+ elif branch.startswith('release'):
persistence_identifier = 'release'
else:
# FIXME: feature branch handling