]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
debian_build: os.environ object does not allow assignment of a list
authorMathias Klette <mathias.klette@profitbricks.com>
Tue, 4 Jun 2013 10:14:51 +0000 (12:14 +0200)
committerMathias Klette <mathias.klette@profitbricks.com>
Tue, 4 Jun 2013 10:14:51 +0000 (12:14 +0200)
debian_build.py

index b54b4987568296d9cc9ac59bfcbe99b20a4e0236..d24f8820606ec949f7b93d12b14316d1cad94458 100755 (executable)
@@ -35,7 +35,6 @@ ENV.setdefault('NO_UPLOAD', '')
 ENV.setdefault('BUILD_TRIGGERS', '')
 #ENV.setdefault('DISTRIBUTION', 'squeeze')
 #GIT_REPO_PATH = ENV['GIT_REPO_PATH']
-ENV['BUILD_TRIGGERS'] = ENV['BUILD_TRIGGERS'].split()
 
 # local constants
 BUILD_START = datetime.datetime.now()
@@ -152,6 +151,7 @@ if __name__ == '__main__':
 
     if re.match(COMMIT_TRIGGER_BRANCHES_RE, ENV['GIT_BRANCH']):
         do_triggers = True
+        build_triggers = ENV['BUILD_TRIGGERS'].split()
     else:
         logger.info('Not evaluating triggers for branch ' + ENV['GIT_BRANCH'])
 
@@ -325,10 +325,10 @@ if __name__ == '__main__':
     # .. do some CI magic now, if requested
     if do_triggers:
 
-        if 'merge' in ENV['BUILD_TRIGGERS'] and local_branch != 'integration':
-            if 'no-test' in ENV['BUILD_TRIGGERS']:
+        if 'merge' in build_triggers and local_branch != 'integration':
+            if 'no-test' in build_triggers:
                 logger.info('Force building with tests as we also merge your branch.')
-                ENV['BUILD_TRIGGERS'].remove('no-test')
+                build_triggers.remove('no-test')
 
             try:
                 src_branch = local_branch        # save the original branch
@@ -345,7 +345,7 @@ if __name__ == '__main__':
             except Exception as error:
                 logger.error('Rebase has failed!', exc_info=error)
 
-        if 'no-test' in ENV['BUILD_TRIGGERS']:
+        if 'no-test' in build_triggers:
             # debian/rules from vdc-bundles determines maven options for tests
             # depending whether DEB_NOTEST environment variable is defined
             # FIXME: ensure this environment variable is available in chroot