[Qa-jenkins-scm] [jenkins.debian.net] 02/05: d-i: set --buildresult to .. to get artifacts to land somewhere that we own

Holger Levsen holger at layer-acht.org
Sat Jun 18 21:34:17 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 1466bd88e1f023b6e1b69c7c62d0b5ba047eb227
Author: Philip Hands <phil at hands.com>
Date:   Fri Jun 17 11:37:01 2016 +0200

    d-i: set --buildresult to .. to get artifacts to land somewhere that we own
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 bin/d-i_build.sh | 79 ++++++++++++++++++++++++++++----------------------------
 1 file changed, 40 insertions(+), 39 deletions(-)

diff --git a/bin/d-i_build.sh b/bin/d-i_build.sh
index 10de832..f045594 100755
--- a/bin/d-i_build.sh
+++ b/bin/d-i_build.sh
@@ -7,12 +7,8 @@ DEBUG=false
 . /srv/jenkins/bin/common-functions.sh
 common_init "$@"
 
-replace_origin_pu() {
-    PREFIX=$1 ; shift
-    BRANCH=$1 ; shift
-    expr "$BRANCH" : 'origin/pu/' >/dev/null || return 1
-    echo "${PREFIX}${BRANCH#origin/pu/}"
-}
+RESULT_DIR=$(readlink -f ..)
+ISO_DIR=/srv/d-i/isos
 
 clean_workspace() {
 	#
@@ -37,6 +33,40 @@ clean_workspace() {
 	echo
 }
 
+replace_origin_pu() {
+	PREFIX=$1 ; shift
+	BRANCH=$1 ; shift
+	expr "$BRANCH" : 'origin/pu/' >/dev/null || return 1
+	echo "${PREFIX}${BRANCH#origin/pu/}"
+}
+
+iso_target() {
+	UI=$1 ; shift
+	echo "${ISO_DIR}/mini-${UI}$(replace_origin_pu "-" $PU_GIT_BRANCH).iso"
+}
+
+preserve_artifacts() {
+	#
+	# Check is we're in a pu/* branch, and if so save the udebs
+	#
+	if PU_BRANCH_DIR=$(replace_origin_pu "/srv/udebs/" $GIT_BRANCH) ; then
+		mkdir -p $PU_BRANCH_DIR
+		cp ${RESULT_DIR}/*.udeb $PU_BRANCH_DIR
+	fi
+
+	#
+	# Alternatively, if we built an images tarball and were triggered by a pu/ branch
+	#
+	IMAGETAR=${RESULT_DIR}/debian-installer-images_*.tar.gz
+	if [ -f $IMAGETAR -a "$PU_GIT_BRANCH" ] ; then
+		[ -d ${ISO_DIR} ] || mkdir ${ISO_DIR}
+
+		tar -xvzf $IMAGETAR --no-anchored mini.iso
+		mv -f installer-*/*/images/netboot/gtk/mini.iso $(iso_target gtk)
+		mv -f installer-*/*/images/netboot/mini.iso $(iso_target text)
+	fi
+}
+
 pdebuild_package() {
 	#
 	# check if we need to do anything
@@ -85,40 +115,13 @@ pdebuild_package() {
 	if PU_BRANCH_DIR=$(replace_origin_pu "/srv/udebs/" $PU_GIT_BRANCH) ; then
 		cp $PU_BRANCH_DIR/* build/localudebs
 	fi
-	pdebuild --use-pdebuild-internal --debbuildopts "-j$NUM_CPU -b" -- --http-proxy $http_proxy
+	pdebuild --use-pdebuild-internal --debbuildopts "-j$NUM_CPU -b" --buildresult ${RESULT_DIR} -- --http-proxy $http_proxy
 	# cleanup
 	echo
-	cat /var/cache/pbuilder/result/${SOURCE}_*changes
+	cat ${RESULT_DIR}/${SOURCE}_*changes
 	echo
-	sudo dcmd rm /var/cache/pbuilder/result/${SOURCE}_*changes
-}
-
-preserve_pu_udebs() {
-    #
-    # Check is we're in a pu/* branch
-    #
-    if PU_BRANCH_DIR=$(replace_origin_pu "/srv/udebs/" $GIT_BRANCH) ; then
-        mkdir -p $PU_BRANCH_DIR
-        cp $WORKSPACE/../*.udeb $PU_BRANCH_DIR
-    fi
-}
-
-iso_target() {
-    UI=$1 ; shift
-
-    echo "/srv/d-i/isos/mini-${UI}$(replace_origin_pu "-" $PU_GIT_BRANCH).iso"
-}
-
-preserve_miniiso() {
-    #
-    # check if we built the images
-    #
-    IMAGETAR=../debian-installer-images_*.tar.gz
-    [ -f $IMAGETAR ] || return 0
-
-    tar -xvzf $IMAGETAR --no-anchored mini.iso
-    mv -f installer-*/*/images/netboot/gtk/mini.iso $(iso_target gtk)
-    mv -f installer-*/*/images/netboot/mini.iso $(iso_target text)
+	preserve_artifacts
+	sudo dcmd rm ${RESULT_DIR}/${SOURCE}_*changes
 }
 
 clean_workspace
@@ -128,8 +131,6 @@ clean_workspace
 #
 if [ "$1" = "" ] ; then
 	pdebuild_package
-	preserve_pu_udebs
-	preserve_miniiso
 else
 	echo do something else ; exit 1
 fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list