]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
debian_build: show help instructions for package build failures
authorMathias Klette <mathias.klette@profitbricks.com>
Wed, 5 Jun 2013 17:28:58 +0000 (19:28 +0200)
committerMathias Klette <mathias.klette@profitbricks.com>
Wed, 5 Jun 2013 17:28:58 +0000 (19:28 +0200)
debian_build.py

index ecea878c931fb33e1aa42125106802acb008191f..bc8f32c44ab82924ae80558ee13424ba786378a5 100755 (executable)
@@ -9,6 +9,7 @@ import git
 import optparse
 import os
 import re
+import socket
 import subprocess
 import sys
 from ConfigParser import SafeConfigParser
@@ -438,6 +439,22 @@ if __name__ == '__main__':
         logger.error(
             'git-buildpackage failed with exitcode {code}'.format(code=ret))
         figlet('Build failed')
+        logger.info('''
+  In case you need to analyze errors within chroot, do the following:
+    * login to {hostname}
+    * become {jenkins_user}
+    * cd into {jenkins_workspace}
+    * export environment variables:
+      export {gpb_env} FORCE_SHELL=TRUE
+    * start build:
+      {command}
+ '''.format(
+        hostname=socket.gethostname(),
+        jenkins_user=ENV['USER'],
+        jenkins_workspace=ENV['WORKSPACE'],
+        gbp_env=' '.join(gbp.env),
+        command=gbp.command,
+    ))
         exit_error()
     else:
         logger.debug('git-buildpackage executed successfully')