]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
send mail if build fails
authorHolger Levsen <holger@layer-acht.org>
Thu, 1 Sep 2011 15:27:32 +0000 (17:27 +0200)
committerHolger Levsen <holger@layer-acht.org>
Thu, 1 Sep 2011 15:27:32 +0000 (17:27 +0200)
build.py

index 862c652a874656b2835cc25381b7b0536abedefc..94d1ae0344ded57f7091f6af787184126cb6dde7 100755 (executable)
--- a/build.py
+++ b/build.py
@@ -404,16 +404,17 @@ if __name__ == '__main__':
     if not ret:
         build_log=os.path.join('../build-area/result/', '%s_%s_amd64.build' % (pkg_name, version))
         fh = open(build_log, 'r')
-        #for line in fh.readlines():
         logger.info('%s' % (fh.read()))
         fh.close()
-    #logger.debug(os.listdir('./'))
-    #logger.debug(os.listdir('../'))
-    create_dput_cfg()
-    changes_file =  '%s_%s_amd64.changes' % (pkg_name, version)
-    dput_package_upload(os.path.join(GIT_TARGET_WORKSPACE, 'build-area/result/', changes_file))
+        exit_error()
+    else:
+        create_dput_cfg()
+        changes_file =  '%s_%s_amd64.changes' % (pkg_name, version)
+        dput_package_upload(os.path.join(GIT_TARGET_WORKSPACE, 'build-area/result/', changes_file))
+        #logger.debug(os.listdir('./'))
+        #logger.debug(os.listdir('../'))
 
-    exit_ok()
+        exit_ok()
 
 #class GitBuildPackage(object):
 #        def __init__(self, upstream_branch=None,