From 11358e87d55c482a04fa9960b0e74f347cd95378 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Tue, 25 Oct 2011 19:46:38 +0200 Subject: [PATCH] add trigger (but not actually call it yet) to build oot binary modules from oot source modules jobs --- build-oot.sh | 68 +++++++++++++++++++++++++++++++++++++++++++++++++ debian_build.py | 6 +++++ 2 files changed, 74 insertions(+) create mode 100755 build-oot.sh diff --git a/build-oot.sh b/build-oot.sh new file mode 100755 index 0000000..4a51db1 --- /dev/null +++ b/build-oot.sh @@ -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 diff --git a/debian_build.py b/debian_build.py index bd38c89..386ed9c 100755 --- a/debian_build.py +++ b/debian_build.py @@ -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) -- 2.39.5