]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
debian_build: change help instructions to be copy&pasteble
authorMathias Klette <mathias.klette@profitbricks.com>
Wed, 5 Jun 2013 17:47:34 +0000 (19:47 +0200)
committerMathias Klette <mathias.klette@profitbricks.com>
Wed, 5 Jun 2013 17:47:34 +0000 (19:47 +0200)
debian_build.py

index a2808dd9de00e3043b509ba9a8b3e395557a8a51..174236b0d3c2c453d3ca11244a8e49dbcf84ba77 100755 (executable)
@@ -436,25 +436,26 @@ if __name__ == '__main__':
 
     # .. now handle the result
     if ret:
-        logger.error(
-            'git-buildpackage failed with exitcode {code}'.format(code=ret))
-        figlet('Build failed')
-        logger.info('''
+        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}
-    * export environment variables:
+    * execute
       export {gbp_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,
-    ))
+
+'''.format(
+            code=ret
+            hostname=socket.gethostname(),
+            jenkins_user=ENV['USER'],
+            jenkins_workspace=ENV['WORKSPACE'],
+            gbp_env=' '.join(['{k}="{v}"'.format(k=i,v=e[i]) for i in gbp.keys()]),
+            command=' '.join(gbp.command),
+        ))
+        figlet('Build failed')
         exit_error()
     else:
         logger.debug('git-buildpackage executed successfully')