--- /dev/null
+#/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
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)