From: Holger Levsen Date: Wed, 28 Sep 2011 13:31:30 +0000 (+0200) Subject: shout in case of errors X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=82d6035c6e96036b5b6fb0fc5a5f6e782f498c7e;p=profitbricks%2Fjenkins-build-scripts.git shout in case of errors --- diff --git a/debian_build.py b/debian_build.py index 707c184..3088a06 100755 --- a/debian_build.py +++ b/debian_build.py @@ -102,6 +102,13 @@ logging.basicConfig( logger = logging.getLogger(__file__) logger.setLevel(logging.DEBUG) +def logger_loud_error(msg): + logger.error('#######################################################################' + logger.error('#######################################################################' + logger.error(msg) + logger.error('#######################################################################' + logger.error('#######################################################################' + def send_email(result): smtp = smtplib.SMTP(SMTP_SERVER) if result == SMTP_BUILD_ERROR: @@ -249,7 +256,7 @@ if __name__ == '__main__': if git_helper.git_clone_remote_repository(GIT_REPO_PATH, GIT_TARGET_DIR): logger.info('git clone was successfull') else: - logger.info('git clone was not successfull') + logger_loud_error('git clone was not successfull') exit_error() atexit.register(remove_git_target_workspace) @@ -263,7 +270,7 @@ if __name__ == '__main__': GIT_UPSTREAM_BRANCH ) else: - logger.error('Could not determine GIT_DEBIAN_BRANCH') + logger_loud_error('Could not determine GIT_DEBIAN_BRANCH') exit_error() elif not GIT_UPSTREAM_BRANCH: if GIT_DEBIAN_BRANCH: @@ -273,7 +280,7 @@ if __name__ == '__main__': GIT_UPSTREAM_BRANCH ) else: - logger.error('Could not determine GIT_UPSTREAM_BRANCH') + logger_loud_error('Could not determine GIT_UPSTREAM_BRANCH') exit_error() repo = git.repo.Repo() @@ -390,7 +397,7 @@ if __name__ == '__main__': if git_helper.git_checkout_branch(GIT_UPSTREAM_BRANCH): logger.info('git checkout %s was successfull' % GIT_UPSTREAM_BRANCH) else: - logger.info('git checkout %s was not successfull' % GIT_UPSTREAM_BRANCH) + logger_loud_error('git checkout %s was not successfull' % GIT_UPSTREAM_BRANCH) exit_error() cmd = ['dpkg-parsechangelog'] @@ -404,6 +411,7 @@ if __name__ == '__main__': ) ret = parse_changelog.wait() if ret: + logger_loud_error('%s was not successfull, return code was %s ' % (' '.join(cmd), ret)) raise Exception( '%s was not successfull, return code was %s ' % (' '.join(cmd), ret) ) @@ -423,6 +431,7 @@ if __name__ == '__main__': ) ret = grep_dctrl.wait() if ret: + logger_loud_error('%s was not successfull, return code was %s ' % (' '.join(cmd), ret)) raise Exception( '%s was not successfull, return code was %s ' % (' '.join(cmd), ret) ) @@ -436,6 +445,7 @@ if __name__ == '__main__': distribution = distribution.strip() logger.info('Packet distribution is %s' % (distribution)) if (options.distribution in ('testing', 'staging') and not distribution in ('testing', 'staging')) or (options.distribution in ('stable', 'stable-proposed-updates', 'production', 'production-proposed-updates') and not distribution in ('stable', 'stable-proposed-updates', 'production', 'production-proposed-updates')): + logger_loud_error('Distribution %s in debian/changelog did not match branch %s' % (distribution, options.distribution)) raise Exception( 'Distribution %s in debian/changelog did not match branch %s' % (distribution, options.distribution) ) @@ -470,7 +480,7 @@ if __name__ == '__main__': logger.info('starting git-buildpackage') ret = gbp.build() if ret: - logger.error( + logger_loud_error( 'git-buildpackage returned non-zero. exitcode was: %s', ret ) exit_error()