# .. actions, define defaults
do_autoincrement = False
do_cidb = False
+ no_cidb_cause = 'default'
do_cleanup = True
+ no_cleanup_cause = 'unknown'
do_liveboot_request = False
+ no_liveboot_cause = 'default'
do_reports = True
+ no_reports_cause = 'unknown'
do_tagging = False
+ no_tagging_cause = 'default'
do_uploads = True
+ no_uploads_cause = 'unknown'
# .. repository related
gitrepo = git.Repo('.')
if not do_autoincrement and len(remote_tag) > 0:
# FIXME: .id attribute but avl. in wheezy based git lib
if remote_tag[0].commit.id == curr_commit_id:
- logger.debug('Tag {name} was already created for commit {sha}.'.format(
+ message = 'Tag {name} was already created for commit {sha}.'.format(
name=remote_tag[0].name,
sha=remote_tag[0].commit.id[0:7],
- ))
+ )
+ logger.debug(message)
do_tagging = False
+ no_tagging_cause = message
else:
logger.error('Tag {name} was already created for commit {sha}.'.format(
name=remote_tag[0].name,
#
# .. do some housekeeping first
if not do_cleanup:
- figlet('Cleanup skipped')
+ figlet('Cleanup skipped - {cause}'.format(
+ cause=no_cleanup_cause
+ ))
else:
# .. reset local repository at first
logger.info('Reset and clean repository.')
if ret:
logger.error('git-buildpackage failed with exitcode {code}'.format(code=ret))
figlet('Build failed')
- exit_error()
+ failed_message = 'package build has failed'
+ do_cidb = False
+ no_cidb_cause = failed_message
+ do_liveboot = False
+ no_liveboot_cause = failed_message
+ do_uploads = False
+ no_uploads_cause = failed_message
else:
figlet('Build OK')
# if reports.tgz exists untar it to workspace and delete it.
# reports.tgz is generated by /root/.pbuilder/hooks.d/B01-test
if not do_reports:
- figlet('Reports skipped')
+ figlet('Reports skipped - {cause}'.format(
+ cause=no_reports_cause
+ ))
else:
try:
reports_file = os.path.join(
# .. let's tag
if not do_tagging:
- figlet('Tagging skipped')
+ figlet('Tagging skipped - {cause}'.format(
+ cause=no_tagging_cause
+ ))
else:
try:
gitrepo.git.tag(new_tag)
# .. and upload
if not do_uploads:
- figlet('Upload skipped')
+ figlet('Upload skipped - {cause}'.format(
+ cause=no_uploads_cause
+ ))
else:
try:
# strip epoch
-
dpkg_build_version = new_version
if ":" in dpkg_build_version:
dpkg_build_version = dpkg_build_version.split(":", 1)[1]
# .. and add all the records to CIDB
if not do_cidb:
- figlet('CIDB skipped')
+ figlet('CIDB skipped - {cause}'.format(
+ cause=no_cidb_cause
+ ))
else:
package_instances = []
try:
# .. finally trigger the next liveboot automatically if we succeed with CIDB
if not do_liveboot_request:
- figlet('Liveboot skipped')
+ figlet('Liveboot skipped - {cause}'.format(
+ cause=no_liveboot_cause
+ ))
else:
if len(package_instances) > 0:
try: