From: Mathias Klette Date: Wed, 16 May 2012 14:19:50 +0000 (+0200) Subject: fix X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=6eade7cf4d00ba07e5fbd96abc0e8e72f892cb0d;p=profitbricks%2Fjenkins-build-scripts.git fix --- diff --git a/debian_build.py b/debian_build.py index 0350554..6a21c94 100755 --- a/debian_build.py +++ b/debian_build.py @@ -28,6 +28,7 @@ from ConfigParser import SafeConfigParser JOB_URL = 'http://jenkins:80/job/%(flavour)s/buildWithParameters?token=BuildIt&' JOB_DELAY = '0sec' +JOB_NAME = os.environ.get('JOB_NAME') GIT = '/usr/bin/git' BIN_RM = '/bin/rm' @@ -47,10 +48,12 @@ CWD = os.environ.get('WORKSPACE') BUILD_NUMBER = os.environ.get('BUILD_NUMBER') BUILD_ID = os.environ.get('BUILD_ID') BUILD_URL = os.environ.get('BUILD_URL') +BUILD_AREA = os.path.abspath(os.path.join(os.curdir,'../build-area')) GIT_REPO_PATH = os.environ.get('GIT_REPO_PATH') GIT_REPO_NAME = os.path.basename(GIT_REPO_PATH) GIT_BRANCH_NAME = os.environ.get('GIT_BRANCH_NAME') +GIT_COMMITTER_EMAIL = os.environ.get('GIT_COMMITTER_EMAIL') #unused: (except in in-active code) GIT_TARGET_WORKSPACE = os.path.join( @@ -63,9 +66,6 @@ GIT_TARGET_DIR = os.path.join( os.path.basename(GIT_REPO_PATH) ) -JOB_NAME = os.environ.get('JOB_NAME') -GIT_COMMITTER_EMAIL = os.environ.get('GIT_COMMITTER_EMAIL') - DPUT_OPTIONS_DEFAULT = { 'fqdn': 'alexandria.profitbricks.localdomain', 'method': 'scp', @@ -427,16 +427,16 @@ if __name__ == '__main__': raise Exception('unhandled branch, failing.') # cleanup existing *orig.tar.gz - if os.path.isdir('../build-area/'): - files = [os.path.join('../build-area/',file) for file in fnmatch.filter(os.listdir('../build-area/'),'*.orig.tar.gz')] + if os.path.isdir(BUILD_AREA): + files = [os.path.join(BUILD_AREA,file) for file in fnmatch.filter(os.listdir(BUILD_AREA),'*.orig.tar.gz')] logger.debug('Previous upstream tarball(s) found: %s' %( files )) - cmd = [BIN_SUDO, BIN_RM, '-vf', " ".join(files)] + cmd = [BIN_SUDO, BIN_RM, '-v', " ".join(files)] cmdobj = subprocess.Popen( cmd, shell=False, cwd='/', close_fds=True, - stdout=sys.stdout, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env={'':''} ) @@ -454,7 +454,7 @@ if __name__ == '__main__': logger.debug(_str) raise Exception(_str) - files = [os.path.join('../build-area/',file) for file in fnmatch.filter(os.listdir('../build-area/'),'*.orig.tar.gz')] + files = [os.path.join(BUILD_AREA,file) for file in fnmatch.filter(os.listdir(BUILD_AREA),'*.orig.tar.gz')] logger.debug('Previous upstream tarball(s) found: %s' %( files ))