if line_counter <= 2:
print('debian/changelog: %s' %(line.strip()))
+ # let's test if we can tag this build, so we can fail early if we cannot tag it later
+ if GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME.startswith('hotfix/'):
+ logger.debug('version: %s' %(version))
+ # replace valid debian version chars that are invalid for git tagging
+ version_tag = version.replace('~','_')
+ version_tag = version_tag.replace(':',',')
+ logger.debug('version_tag: %s' %(version_tag))
+ cmd = ['/usr/bin/git', 'tag', version_tag]
+ try:
+ subprocess.check_call(cmd)
+ except:
+ logger.error('Could not tag repository with "%s".' % version_tag)
+ exit_error()
+ cmd = ['/usr/bin/git', 'tag', '-d', version_tag]
+ try:
+ subprocess.check_call(cmd)
+ except:
+ logger.error('Could not delete tag "%s" from repository.' % version_tag)
+ exit_error()
+ logger.info('Tagged as "%s" woks, tag does not exist yet.' % version_tag)
+
# set pb_suite which GitBuildPackage() will turn into PB_SUITE
# if we wrote a changelog entry, use that one
if GIT_BRANCH_NAME.startswith('feature/') or GIT_BRANCH_NAME.startswith('poc/') or GIT_BRANCH_NAME.startswith('bugfix/') or GIT_BRANCH_NAME == 'develop' or GIT_BRANCH_NAME == 'pre-staging' or GIT_BRANCH_NAME.startswith('release/'):