return parser.parse_args()
if __name__ == '__main__':
- logger.debug('Environment:\n{env}'.format(env=pformat(ENV)))
+ logger.debug('Start-up environment:\n\n{env}\n'.format(env=pformat(ENV)))
# Act I: prepare variables
# .. command line arguments
)
# show what we got so far
- logger.debug('Distribution: "{old_dist}" => "{new_dist}"'.format(
+ logger.info('Changelog distribution: "{old_dist}" => "{new_dist}"'.format(
old_dist=curr_dist,
new_dist=new_dist,
))
- logger.debug('Version: "{old_version}" => "{new_version}"'.format(
+ logger.info('Changelog version: "{old_version}" => "{new_version}"'.format(
old_version=curr_version,
new_version=new_version,
))
- logger.debug('PB_SUITE: {suite}'.format(
+ logger.info('PB_SUITE (used by pbuilder): {suite}'.format(
suite=pb_suite,
))
if do_tagging:
- logger.debug('Tag to create: {tag}'.format(
+ logger.info('Tag to create: {tag}'.format(
tag=new_tag,
))
- logger.debug('Upload configuration:\n{config}'.format(
- config=pformat(dput_obj.contents),
+ logger.info('Upload configuration (for reprepro):\n\n{config}\n'.format(
+ config=pformat(dput_obj.contents)
))
#
# ACT III: do something actually
#
-
# .. do some housekeeping first
if not do_cleanup:
figlet('Cleanup skipped')
gitrepo.git.branch('-D', local_branch, with_exceptions=False).strip()
# .. and re-checkout the requested branch
- logger.info('Checkout branch {branch}.'.format(branch=remote_branch))
- gitrepo.git.checkout('-b', local_branch, remote_branch).strip()
- logger.debug('Status is now:\n{status}'.format(
+ logger.info('Checkout branch {branch}.\n\n{checkout}\n{status}\n'.format(
+ branch=remote_branch,
+ checkout=gitrepo.git.checkout('-b', local_branch, remote_branch).strip(),
status=gitrepo.git.status().strip(),
))
if len(files) > 0:
logger.info('Delete previous upstream tarball(s)')
- cmd = [BIN_SUDO, BIN_RM, '-v'] + files
+ cmd = [BIN_SUDO, BIN_RM] + files
+ command = ' '.join(cmd)
if subprocess.check_call(cmd) == 0:
- logger.info('{command} succeeded.'.format(command=cmd))
+ logger.debug('%s succeeded.' % command)
else:
- logger.warn('{command} failed.'.format(cmd))
+ logger.warn('%s failed.' % command)
figlet('Cleanup OK')
# TODO: use changelog python libs instead of DCH calls, see above
cl = changelog.Changelog()
cl.parse_changelog(open('debian/changelog'))
- logger.info('New changelog:\n\n{changelog}'.format(
- changelog=''.join([block.__str__() for block in cl._blocks[0:2]])),
- )
+ logger.info('New changelog:')
+ for block in cl._blocks[0:2]:
+ for line in block.__str__().split('\n'):
+ logger.info(' ' + line)
#
# ACT IV: preparations are done, let's build
#
- logger.info('Building ...')
+ logger.info('Current environment:\n\n{env}\n'.format(env=ENV))
+ logger.info('Start building ...\n')
+
gbp = git_buildpackage.GitBuildPackage(
upstream_branch=local_branch,
debian_branch=local_branch,
# .. now handle the result
if ret:
+ figlet('Build failed')
logger.error('''git-buildpackage failed with exitcode {code}
-##
-##
-## In case you need to analyze errors within chroot, do the following:
-## * login to {hostname}
-## * become {jenkins_user}
-## * cd into {jenkins_workspace}
-## * then execute:
+###
+### In case you need to analyze errors within chroot, do the following:
+### * login to {hostname}
+### * become {jenkins_user}
+### * cd into {jenkins_workspace}
+### * then execute:
+###
export {gbp_env} FORCE_SHELL=TRUE
{command}
-##
-##
+###
+###
'''.format(
code=ret,
hostname=socket.gethostname(),
]),
command=' '.join(gbp.command),
))
- figlet('Build failed')
exit_error()
else:
- logger.debug('git-buildpackage executed successfully')
figlet('Build OK')
#