else:
logger.debug('git-buildpackage executed successfully')
build_log=os.path.join('../build-area/result/', '%s_%s_amd64.build' % (pkg_name, version))
+ # build was succesful, now let's tag it
+ if GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME.startswith('hotfix/'):
+ # replace ~ with _ for tags
+ version_tag = version.replace('~','_')
+ if version_tag.find(":"):
+ logger_error('Illegal character ":" in version %s detected. Please use a different version.' % version_tag)
+ exit_error()
+ 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', 'push', 'origin', version_tag]
+ try:
+ subprocess.check_call(cmd)
+ pass:
+ logger.info('Tagged as %s' % version_tag)
+ except:
+ logger_error('Could not push tag %s to repository.' % version_tag)
+ exit_error()
try:
+ # now upload
create_dput_cfg()
# strip epoch
if ":" in version:
logger.exception(error)
exit_error()
- # build was succesful, now let's tag it
- if GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME.startswith('hotfix/'):
- cmd = ['/usr/bin/git', 'tag', version]
- try:
- subprocess.check_call(cmd)
- except:
- logger_error('Could not tag repository.')
- exit_error()
- cmd = ['/usr/bin/git', 'push', 'origin', version]
- try:
- subprocess.check_call(cmd)
- except:
- logger_error('Could not push tag.')
- exit_error()
-
# finally
exit_ok()