]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
actually trigger source builds
authorHolger Levsen <holger@layer-acht.org>
Thu, 3 Nov 2011 16:11:23 +0000 (17:11 +0100)
committerHolger Levsen <holger@layer-acht.org>
Thu, 3 Nov 2011 16:11:23 +0000 (17:11 +0100)
kernel_build.py

index bf5a4e3c9a43ed65039ade96c07e4545d459a4e9..d3838a1daceecf58c2ad7834ef258d04d70dfd3b 100644 (file)
@@ -12,6 +12,10 @@ import smtplib
 from glob import glob
 from logging import Formatter
 import kernel_persistence
+import urllib
+
+JOB_URL = 'http://rwittler:MiMaMopel@jenkins:80/job/%(flavour)s-source/buildWithParameters?'
+JOB_DELAY = '0sec'
 
 CWD = os.environ.get('WORKSPACE')
 BUILD_NUMBER = os.environ.get('BUILD_NUMBER')
@@ -160,4 +164,28 @@ if __name__ == '__main__':
         new_version, 'kernel_inpbuilder.py',
             dist='stable'):
         exit_error()
+
+    # trigger source build
+    logger.info('Triggering source build now')
+    flavour=GIT_REPO_NAME[6:-4]
+    urlencode_expansion_dict = {
+       'flavour': 'linux-%s' % flavour
+    }
+    url = HudsonUrl()
+    data = urllib.urlencode(
+        (
+            ('GIT_REPO_PATH', GIT_REPO_PATH),
+            ('DISTRIBUTION', pb_suite),
+            ('delay', JOB_DELAY)
+        )
+    )
+    ret = url.open(JOB_URL %(urlencode_expansion_dict) + '%s' %(data))
+
+    if ret.code == 200:
+        logger.info('jenkins url called successfully.')
+    else:
+        logger.info('URL was %s' % JOB_URL %(urlencode_expansion_dict) + '%s' %(data))
+        logger.info('jenkins sends the following: %s' %(ret.read())                    )
+        exit_error()
+
     exit_ok()