]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
add trigger (but not actually call it yet) to build oot binary modules from oot sourc...
authorHolger Levsen <holger@layer-acht.org>
Tue, 25 Oct 2011 17:46:38 +0000 (19:46 +0200)
committerHolger Levsen <holger@layer-acht.org>
Tue, 25 Oct 2011 17:46:38 +0000 (19:46 +0200)
build-oot.sh [new file with mode: 0755]
debian_build.py

diff --git a/build-oot.sh b/build-oot.sh
new file mode 100755 (executable)
index 0000000..4a51db1
--- /dev/null
@@ -0,0 +1,68 @@
+#/bin/sh
+
+# Holger Levsen 2011
+
+# FIXME: the way ssh is used below is just wrong. but it's also used like this in other parts of the
+#       jenkins builds scripts, so we'll need to cleanup anyway...
+
+set -e
+
+if [ -z "$1" ] ; then
+       echo "need OOT_MODULE!"
+       exit 1
+else
+       OOT_MODULE=$1
+fi
+
+if [ -z "$2" ] ; then
+       echo "need PB_FLAVOUR!"
+       exit 1
+else
+       PB_FLAVOUR=$2
+fi
+
+if [ -z "$3" ] ; then
+       echo "need DIST!"
+       exit 1
+else
+       export DIST=$3
+fi
+
+if [ -z "$4" ] ; then
+       echo "need PB_SUITE!"
+       exit 1
+else
+       export PB_SUITE=$4
+fi
+
+TMPFILE=$(mktemp)
+
+echo "Building $OOT_MODULE for kernel profitbricks-$PB_FLAVOUR for $DIST and $PB_SUITE using script in $TMPFILE which has this content:"
+
+cat > $TMPFILE << EOF
+#!/bin/sh
+# this is $TMPFILE
+
+        set -e
+        apt-get update
+        apt-get -y install openssh-client linux-source-profitbricks-$PB_FLAVOUR $OOT_MODULE-source linux-image-profitbricks-$PB_FLAVOUR
+        m-a unpack $OOT_MODULE
+        cd /usr/src/
+        tar xjf linux-source-*-$PB_FLAVOUR.tar.bz2
+        KDIR=\$(find /usr/src -name "*profitbricks-$PB_FLAVOUR*" -type d)
+        cd \$KDIR
+        cp /boot/config-*-$PB_FLAVOUR .config
+        make prepare
+        make modules_prepare
+        m-a -k \$KDIR build $OOT_MODULE
+        cd /usr/src/
+        ls *deb
+       # FIXME: this is soooo just wrong...
+       scp -o "StrictHostKeyChecking no" -i /root/.ssh/id_rsa_jenkins *.deb reprepro@alexandria.profitbricks.localdomain:/srv/profitbricks-repository/incoming/profitbricks/$PB_SUITE/
+
+EOF
+cat $TMPFILE
+
+sudo pbuilder --execute --bindmounts "/root" -- $TMPFILE
+
+rm $TMPFILE
index bd38c89bcdcb5230dac5374085ee80171601c07b..386ed9c5cf28a3cef7f5779cd9f058281094db4b 100755 (executable)
@@ -479,6 +479,12 @@ if __name__ == '__main__':
             fh.close()
             # upload
             dput_package_upload(changes_file)
+            # build oot binary modules for all defined flavours
+            FLAVOURS_FILE=os.join(GIT_TARGET_WORKSPACE,"debian/pb_flavours")
+            fh = open(FLAVOURS_FILE, 'r')
+            for flavour in fh.read():
+                logger.info('trigger_oot_binary_builds %s %s %s %s' % (JOB_NAME, flavour, DIST, PB_SUITE))
+            fh.close()
             exit_ok()
         except Exception, error:
             logger.exception(error)