From: Holger Levsen Date: Tue, 25 Oct 2011 21:38:17 +0000 (+0200) Subject: only try to build oot-modules if the package is oot-source packge, fix scp upload... X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=6a1cd98fc300b26c047205fc0003b8aa65c7d18d;p=profitbricks%2Fjenkins-build-scripts.git only try to build oot-modules if the package is oot-source packge, fix scp upload path, fail on error --- diff --git a/build-oot.sh b/build-oot.sh index 4a51db1..6ac3ab0 100755 --- a/build-oot.sh +++ b/build-oot.sh @@ -43,6 +43,7 @@ cat > $TMPFILE << EOF #!/bin/sh # this is $TMPFILE + set +x set -e apt-get update apt-get -y install openssh-client linux-source-profitbricks-$PB_FLAVOUR $OOT_MODULE-source linux-image-profitbricks-$PB_FLAVOUR @@ -58,7 +59,7 @@ cat > $TMPFILE << EOF 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/ + scp -o "StrictHostKeyChecking no" -i /root/.ssh/id_rsa_jenkins *.deb reprepro@alexandria.profitbricks.localdomain:/srv/profitbricks-repository/incoming/$PB_SUITE/ EOF cat $TMPFILE diff --git a/debian_build.py b/debian_build.py index 9c29f9d..68398e0 100755 --- a/debian_build.py +++ b/debian_build.py @@ -480,7 +480,14 @@ if __name__ == '__main__': fh.close() # upload dput_package_upload(changes_file) - # build oot binary modules for all defined flavours + except Exception, error: + logger.exception(error) + exit_error() + + # build out-of-tree kernel module binary packages for all defined + # flavours (if the package is a oot-source package) + FLAVOURS_FILE=os.path.join(GIT_TARGET_WORKSPACE, GIT_REPO_NAME, "debian/pb_flavours") + if os.path.exists(FLAVOURS_FILE): logger.info('Sleeping for 60 sec. so reprepro can process upload....') time.sleep(60) # give reprepro time to process FLAVOURS_FILE=os.path.join(GIT_TARGET_WORKSPACE, GIT_REPO_NAME, "debian/pb_flavours") @@ -495,8 +502,9 @@ if __name__ == '__main__': ret = os.system('%s' %(' '.join(cmd))) if ret: logger_loud_error('"%s" returned non-zero (exitcode was: %s).' % (' '.join(cmd), ret)) + logger.exception(error) + exit_error() fh.close() - exit_ok() - except Exception, error: - logger.exception(error) - exit_error() + + exit_ok() +