]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
remove CWD variable from common_code
authorMathias Klette <mathias.klette@profitbricks.com>
Thu, 2 May 2013 08:38:14 +0000 (10:38 +0200)
committerMathias Klette <mathias.klette@profitbricks.com>
Thu, 2 May 2013 08:38:14 +0000 (10:38 +0200)
- 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
debian_build.py

index fc58765580f57fe727dbf2375c1df8db18882b62..dc560c4e0b0c30d2e15e198ae890e12df1dc14d2 100755 (executable)
@@ -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']
-
index 0d9c206a76914d930d7dd640b8af3e04e12416db..34c8999e74b250076ea4c7b96a176082ff4f405c 100755 (executable)
@@ -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()))