From: Holger Levsen Date: Thu, 3 Nov 2011 16:11:23 +0000 (+0100) Subject: actually trigger source builds X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=d168aa4ff5282805210b7244b10f669f71c75f9e;p=profitbricks%2Fjenkins-build-scripts.git actually trigger source builds --- diff --git a/kernel_build.py b/kernel_build.py index bf5a4e3..d3838a1 100644 --- a/kernel_build.py +++ b/kernel_build.py @@ -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()