From: Holger Levsen Date: Thu, 3 Nov 2011 14:45:27 +0000 (+0100) Subject: provide infrastructure for source-only builds X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=09faf2611f59bbac350d9daa77169963ca250083;p=profitbricks%2Fjenkins-build-scripts.git provide infrastructure for source-only builds --- diff --git a/kernel_build.py b/kernel_build.py index ad21534..ec2ecf6 100644 --- a/kernel_build.py +++ b/kernel_build.py @@ -24,6 +24,8 @@ GIT_OLD_ID = os.environ.get('GIT_OLD_ID') GIT_NEW_ID = os.environ.get('GIT_NEW_ID') GIT_BRANCH_NAME = os.environ.get('GIT_BRANCH_NAME') +SOURCE_BUILD = os.environ.get('SOURCE_BUILD') + GIT_COMMITTER_EMAIL = os.environ.get('GIT_COMMITTER_EMAIL') SMTP_SERVER = 'roma.profitbricks.localdomain' @@ -68,6 +70,12 @@ def send_email(result): def build_kernel_with_pbuilder(revision, pbuilder_script, dist='stable'): pbuilder_script = os.path.abspath(pbuilder_script) + + if SOURCE_BUILD: + SOURCE_BUILD='--source-only' + else + SOURCE_BUILD='' + cmd = [ SUDO, PBUILDER, @@ -88,6 +96,7 @@ def build_kernel_with_pbuilder(revision, pbuilder_script, dist='stable'): '--revision', '%s' %(revision), '--dist', '%s' %(dist), '--overlay-dir', '%s' % os.path.join(CWD,'kernel-package-overlay'), + SOURCE_BUILD ] os.environ.update({'DIST': '%s' %(dist)}) diff --git a/kernel_inpbuilder.py b/kernel_inpbuilder.py index 57b73bc..cff705f 100644 --- a/kernel_inpbuilder.py +++ b/kernel_inpbuilder.py @@ -137,6 +137,13 @@ def getopts(): help='Set the overlay-dir for make-kpkg Default: %default' ) + parser.add_option( + '--source_only', + dest='source_only', + default=False, + help='If set, only build source packages. Default: %default' + ) + return parser.parse_args() def git_clone_remote_repository(url, destination): @@ -378,6 +385,9 @@ if __name__ == '__main__': OVERLAY_DIR = options.overlay_dir or '/usr/share/kernel-package' + if options.source_only: + logger.info('Lets build only sources') + # add current dir to python search path cmd_folder = os.path.join(os.path.abspath(OVERLAY_DIR), '..') sys.path.insert(0, cmd_folder)