From: Holger Levsen Date: Tue, 25 Oct 2011 18:12:48 +0000 (+0200) Subject: correctly trigger build and sleep 60sec before doing so X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=b0e14870fce1a2c272654a1a31fbf65f91207118;p=profitbricks%2Fjenkins-build-scripts.git correctly trigger build and sleep 60sec before doing so --- diff --git a/debian_build.py b/debian_build.py index c6160ad..0ea5fda 100755 --- a/debian_build.py +++ b/debian_build.py @@ -15,6 +15,7 @@ import optparse import datetime import platform import subprocess +import time from glob import glob from ftplib import FTP from lib import git_helper @@ -480,6 +481,8 @@ if __name__ == '__main__': # upload dput_package_upload(changes_file) # build oot binary modules for all defined flavours + logger.info('Sleeping for 60 sec. so reprepro can process upload....') + time.sleep(60) # give reprepro time to process FLAVOURS_FILE=os.path.join(GIT_TARGET_WORKSPACE, GIT_REPO_NAME, "debian/pb_flavours") fh = open(FLAVOURS_FILE, 'r') for flavour in fh.read(): @@ -488,8 +491,23 @@ if __name__ == '__main__': '%s' % flavour, '%s' % options.distribution, '%s' % pb_suite ] - logger.info('calling %s' % cmd) - subprocess.check_call(cmd) + cmdobj = subprocess.Popen( + cmd, + shell=False, + close_fds=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + env=os.environ + ) + logger.info('calling "%s" ...', ' '.join(cmd)) + ret = os.system('%s' %(' '.join(cmd))) + if ret: + logger.error( + '"%s" returned non-zero (exitcode was: %s).', + ' '.join(cmd), + ret, + ) + return False fh.close() exit_ok() except Exception, error: