]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
provide infrastructure for source-only builds
authorHolger Levsen <holger@layer-acht.org>
Thu, 3 Nov 2011 14:45:27 +0000 (15:45 +0100)
committerHolger Levsen <holger@layer-acht.org>
Thu, 3 Nov 2011 14:45:27 +0000 (15:45 +0100)
kernel_build.py
kernel_inpbuilder.py

index ad21534a556945e9680b9b0b34e0e5ef008ee865..ec2ecf6857c4ddc284f3d0e5d9bd5590793b48a1 100644 (file)
@@ -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)})
index 57b73bcf40c33ff8f67a54acc067396b9210c3f0..cff705ff92137e37dcd3e9d3f5b17b460ce50156 100644 (file)
@@ -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)