summaryrefslogtreecommitdiffstats
path: root/bin/d-i_build.sh
diff options
context:
space:
mode:
authorPhilip Hands <phil@hands.com>2016-07-18 13:58:12 +0200
committerHolger Levsen <holger@layer-acht.org>2016-07-18 19:59:17 +0200
commitf7e88d07551f9c1c71ca72d8653e68cde1dbe883 (patch)
tree48b8a30bac8953cbad0f6eb4e78aed6b61a2cd4d /bin/d-i_build.sh
parent7e8292ff4b05ad1e3b29268a816b4f2abed667d5 (diff)
downloadjenkins.debian.net-f7e88d07551f9c1c71ca72d8653e68cde1dbe883.tar.xz
d-i: inject variables for later triggers
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin/d-i_build.sh')
-rwxr-xr-xbin/d-i_build.sh27
1 files changed, 17 insertions, 10 deletions
diff --git a/bin/d-i_build.sh b/bin/d-i_build.sh
index e2af277d..e076a70d 100755
--- a/bin/d-i_build.sh
+++ b/bin/d-i_build.sh
@@ -46,23 +46,26 @@ replace_origin_pu() {
iso_target() {
UI=$1 ; shift
- echo "${ISO_DIR}/mini-${UI}$(replace_origin_pu "-" $PU_GIT_BRANCH).iso"
+ BRANCH=$1 ; shift
+ echo "${ISO_DIR}/mini-${UI}${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
+ if udeb_dir=$(replace_origin_pu "/srv/udebs/" $GIT_BRANCH) ; then
+ mkdir -p $udeb_dir
+ cp ${RESULT_DIR}/*.udeb $udeb_dir
+ # this is put into env.txt below, so that the variable(s) can be injected into the jenkins environment
+ ENV_TO_INJECT="OUR_BRANCH=$GIT_BRANCH"
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
+ if [ -f $IMAGETAR -a "$TRIGGERING_BRANCH" ] ; then
[ -d ${ISO_DIR} ] || mkdir ${ISO_DIR}
echo "untaring the .iso images from $IMAGETAR:"
@@ -70,8 +73,9 @@ preserve_artifacts() {
echo "sha256sum of .iso images:"
sha256sum installer-*/*/images/netboot/gtk/mini.iso installer-*/*/images/netboot/mini.iso
echo "move them into place..."
- mv -f installer-*/*/images/netboot/gtk/mini.iso $(iso_target gtk)
- mv -f installer-*/*/images/netboot/mini.iso $(iso_target text)
+ BRANCH=$(replace_origin_pu "-" $TRIGGERING_BRANCH)
+ mv -f installer-*/*/images/netboot/gtk/mini.iso $(iso_target gtk $BRANCH)
+ mv -f installer-*/*/images/netboot/mini.iso $(iso_target text $BRANCH)
echo "and see if they are there (listing creation time):"
ls -ltrc $ISO_DIR
@@ -126,11 +130,11 @@ pdebuild_package() {
NUM_CPU=1
fi
#
- # if we got a valid PU_GIT_BRANCH passed in as a parameter from the triggering job
+ # if we got a valid TRIGGERING_BRANCH passed in as a parameter from the triggering job
# then grab the generated udebs. FIXME -- we need to work work out a way of cleaning up old branches
#
- if PU_BRANCH_DIR=$(replace_origin_pu "/srv/udebs/" $PU_GIT_BRANCH) ; then
- cp $PU_BRANCH_DIR/* build/localudebs
+ if udeb_dir=$(replace_origin_pu "/srv/udebs/" $TRIGGERING_BRANCH) ; then
+ cp $udeb_dir/* build/localudebs
fi
pdebuild --use-pdebuild-internal --debbuildopts "-j$NUM_CPU -b" --buildresult ${RESULT_DIR} -- --http-proxy $http_proxy
# cleanup
@@ -152,3 +156,6 @@ else
echo do something else ; exit 1
fi
clean_workspace
+
+# write out the environment variable(s) for injection into jenkins job
+echo "$ENV_TO_INJECT" > env.txt