From 17930bc44c94a4a92810aad11c5d6a8e0de7c104 Mon Sep 17 00:00:00 2001 From: Mathias Klette Date: Thu, 2 May 2013 10:38:14 +0200 Subject: [PATCH] remove CWD variable from common_code - which used jenkins provided environment variable 'WORKSPACE' - this in turns leads to errors in debian_repos2db.sh when no such variable exists - replaced all occurences of CWD in debian_build with it's corresponding ENV['WORKSPACE'] variable --- common_code.py | 3 --- debian_build.py | 10 +++++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/common_code.py b/common_code.py index fc58765..dc560c4 100755 --- a/common_code.py +++ b/common_code.py @@ -54,6 +54,3 @@ BUILD_ARCH_MAP = { } BUILD_ARCH = BUILD_ARCH_MAP.get(platform.machine(), '686') BUILD_AREA = os.path.abspath(os.path.join(os.curdir,'../build-area')) - -CWD = ENV['WORKSPACE'] - diff --git a/debian_build.py b/debian_build.py index 0d9c206..34c8999 100755 --- a/debian_build.py +++ b/debian_build.py @@ -58,7 +58,7 @@ BUILD_START = datetime.datetime.now() #unused: (except in in-active code) GIT_TARGET_WORKSPACE = os.path.join( - CWD, + ENV['WORKSPACE'], ('%s-build%s' %(ENV['BUILD_ID'], ENV['BUILD_NUMBER'])), ) #unused: (except in in-active code) @@ -83,7 +83,7 @@ DPUT_OPTIONS_DEV = { 'allow_unsigned_uploads': 1, 'post_upload_command': 'ssh reprepro@alexandria.pb.local /srv/dev-repository/bin/pb_processincoming', } -DPUT_CF = os.path.join(CWD, '..', 'dput.cf') +DPUT_CF = os.path.join(ENV['WORKSPACE'], '..', 'dput.cf') AUTO_CHANGELOG_JOBS = ( 'ri-docs', @@ -568,10 +568,10 @@ if __name__ == '__main__': # # if reports.tgz exists untar it to workspace and delete it. # reports.tgz is generated by /root/.pbuilder/hooks.d/B01-test - cmd = ['/bin/tar', 'xzvf', os.path.join(CWD, '../build-area/result/reports.tgz'), '-C', CWD] + cmd = ['/bin/tar', 'xzvf', os.path.join(ENV['WORKSPACE'], '../build-area/result/reports.tgz'), '-C', ENV['WORKSPACE']] try: subprocess.check_call(cmd) - cmd = ['/usr/bin/sudo' , '/bin/rm', os.path.join(CWD, '../build-area/result/reports.tgz')] + cmd = ['/usr/bin/sudo' , '/bin/rm', os.path.join(ENV['WORKSPACE'], '../build-area/result/reports.tgz')] subprocess.check_call(cmd) except: pass @@ -603,7 +603,7 @@ if __name__ == '__main__': # strip epoch if ":" in version: version = version.split(":", 1)[1] - changes_file = os.path.join(CWD, '../build-area/result/', '%s_%s_amd64.changes' % (pkg_name, version)) + changes_file = os.path.join(ENV['WORKSPACE'], '../build-area/result/', '%s_%s_amd64.changes' % (pkg_name, version)) # display changes file fh = open(changes_file, 'r') logger.info('%s' % (fh.read())) -- 2.39.5