]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
debian_build: less code for trigger handling
authorMathias Klette <mathias.klette@profitbricks.com>
Tue, 4 Jun 2013 11:12:26 +0000 (13:12 +0200)
committerMathias Klette <mathias.klette@profitbricks.com>
Tue, 4 Jun 2013 11:12:26 +0000 (13:12 +0200)
debian_build.py

index f340f3e1d15d6b261dcc0ead91298eabf87fa294..ecea878c931fb33e1aa42125106802acb008191f 100755 (executable)
@@ -109,7 +109,6 @@ if __name__ == '__main__':
     do_liveboot_request = False
     do_reports = True
     do_tagging = False
-    do_triggers = False
     do_uploads = True
 
     cl = changelog.Changelog()
@@ -149,12 +148,6 @@ if __name__ == '__main__':
         ))
         curr_dist = 'squeeze'
 
-    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'])
-
     if re.match(STABLE_BRANCHES_RE, ENV['GIT_BRANCH']):
         if re.match('^(ps_|dev_).*$', ENV['JOB_NAME']):
             logger.error('Use the appropriate job to build for branch "{branch}"!'.format(
@@ -270,10 +263,6 @@ if __name__ == '__main__':
     logger.debug('PB_SUITE: {suite}'.format(
         suite=pb_suite,
     ))
-    if do_triggers:
-        logger.debug('Triggers found: {tags}.'.format(
-            tags=', '.join(build_triggers),
-        ))
     if do_tagging:
         logger.debug('Tag to create: {tag}'.format(
             tag=new_tag,
@@ -323,9 +312,12 @@ if __name__ == '__main__':
         figlet('Cleanup OK')
 
     # .. do some CI magic now, if requested
-    if do_triggers:
+    if not re.match(COMMIT_TRIGGER_BRANCHES_RE, ENV['GIT_BRANCH']):
+        logger.info('Not evaluating triggers for branch ' + ENV['GIT_BRANCH'])
+    else:
+        build_triggers = ENV['BUILD_TRIGGERS'].split()
 
-        if 'merge' in build_triggers and local_branch != 'integration':
+        if 'merge' in build_triggers:
             if 'no-test' in build_triggers:
                 logger.info('Force building with tests as we also merge your branch.')
                 build_triggers.remove('no-test')