# Act II: make decissions
# compatibility until call_jenkins was replaced
if ENV['DISTRIBUTION'] not in ('squeeze','wheezy'):
- logger.warn('Compatbility Mode: Change distribution {old} => {new}.'.format(
- old = ENV['DISTRIBUTION'],
+ logger.warn('Compatibility Mode: Change distribution {old} => {new}.'.format(
+ old = ENV['DISTRIBUTIONS'],
new = 'squeeze'
))
ENV['DISTRIBUTION'] = 'squeeze'
exit_error()
new_dist = 'stable'
new_version = '{version}'.format(version = curr_version)
- pb_suite = 'master-' + curr_dist
- reprepro_base = '/srv/pb-' + curr_dist
+ pb_suite = 'master-' + ENV['DISTRIBUTION']
+ reprepro_base = '/srv/pb-' + ENV['DISTRIBUTION']
# replace valid debian version chars that are invalid for git tagging
new_tag = curr_version.replace('~','_')
new_tag = new_tag.replace(':',',')
# .. only take care of changelog automation if we want it to
+ # FIXME: this must be reponame in ...
if ENV['GIT_BRANCH'] in AUTO_CHANGELOG_REPONAMES:
do_autoincrement = True
# reset actions
build = ENV['BUILD_NUMBER'],
commit = curr_commit_id[0:7],
)
- pb_suite = 'develop-' + curr_dist
- reprepro_base = '/srv/pb-' + curr_dist
+ pb_suite = 'develop-' + ENV['DISTRIBUTION']
+ reprepro_base = '/srv/pb-' + ENV['DISTRIBUTION']
# reset actions
# .. always include successful build packages into CIDB
if ENV['DISTRIBUTION'] == 'squeeze':
))
exit_error()
- new_dist = 'dev-' + ENV['GIT_BRANCH'].replace("/","-")
+ new_dist = 'dev-' + local_branch.replace("/","-")
new_version = '{version}~experimental{date}+{build}+{commit}'.format(
version = curr_version,
date = daily_date,
build = ENV['BUILD_NUMBER'],
commit = curr_commit_id[0:7],
)
- pb_suite = 'experimental-' + curr_dist
- reprepro_base = '/srv/dev-' + curr_dist
+ pb_suite = 'experimental-' + ENV['DISTRIBUTION']
+ reprepro_base = '/srv/dev-' + ENV['DISTRIBUTION']
else:
logger.error('Don\'t know how to handle branch "{branch}".'.format(
logger.debug('Version: "%s" => "%s"' %(curr_version, new_version))
logger.debug('PB_SUITE: ' + pb_suite)
if do_triggers:
- logger.debug('Triggers found: ' + commit_triggers)
+ logger.debug('Triggers found: ' + ', '.join(commit_triggers))
if do_tagging:
logger.debug('Tag to create: ' + new_tag)
logger.debug('Upload configuration:\n%s' %(pformat(dput_obj.contents)))
if len(files) > 0:
logger.info('Delete previous upstream tarball(s)')
cmd = [BIN_SUDO, BIN_RM, '-v'] + files
- if subprocess.check_call(cmd):
+ if subprocess.check_call(cmd) == 0:
logger.info('%s succeeded.' % cmd)
else:
logger.warn('%s failed.' % cmd)
logger.info('Force building with tests as we also merge your branch.')
commit_triggers.remove('no-test')
- src_branch = ENV['GIT_BRANCH'] # save the original branch
+ src_branch = local_branch # save the original branch
dst_branch = 'integration' # define the new branch
- ENV['GIT_BRANCH'] = dst_branch # reset env for git-buildpackage
+ local_branch = dst_branch # reset env for git-buildpackage
# FIXME: error handling when rebase doesn't cleanly complete?
gitrepo.git.rebase('--onto', dst_branch, src_branch)
gitrepo.git.checkout(dst_branch)
# ACT IV: preparations are done, let's build
logger.info('Building ...')
gbp = git_buildpackage.GitBuildPackage(
- upstream_branch = ENV['GIT_BRANCH'],
- debian_branch = ENV['GIT_BRANCH'],
+ upstream_branch = local_branch,
+ debian_branch = local_branch,
dist = ENV['DISTRIBUTION'],
arch = 'amd64',
pb_suite = pb_suite,
if os.path.exists(reports_file):
for cmd in (['/bin/tar', 'xzvf', reports_file, '-C', ENV['WORKSPACE']],
['/usr/bin/sudo' , '/bin/rm', '-v', reports_file]):
- if not subprocess.check_call(cmd):
- logger.warn(cmd + ' failed.')
- else:
+ if subprocess.check_call(cmd) == 0:
logger.info(cmd + ' succeeded.')
+ else:
+ logger.warn(cmd + ' failed.')
else:
logger.info('No reports found.')
figlet('Reports OK')