export PB_SUITE=$DISTRIBUTION
export TARGET_BASE=/srv/storage-kernels
+function get_last_target_build_no() {
+ TARGET_NAME=$1
+
+ if [ -n "$TARGET_NAME" ]; then
+ retval=$(find $TARGET_BASE/$TARGET_NAME -maxdepth 1 -type d \
+ | grep -v "^.$" | sort -n | tail -n 1 \
+ | sed -e "s|^\.\/||g" | sed -e "s|.*\/\([^\.]*\)$|\1|g")
+ [ -z "$retval" ] && retval="0"
+ else
+ retval="0"
+ fi
+
+ echo $retval
+}
+
if [ "$DISTRIBUTION" = "production-proposed-updates" ] ; then
export TARGET_NAME=master
elif [ "$DISTRIBUTION" = "pre-staging" ] ; then
export TARGET_NAME=develop
elif [[ "$DISTRIBUTION" = dev-feature* ]] ; then
export TARGET_NAME=$DISTRIBUTION
+ LAST_DEVELOP_BUILD_NO=$(get_last_target_build_no develop)
+ BUILD_NUMBER="$LAST_DEVELOP_BUILD_NO.$(printf %03d $BUILD_NUMBER)"
FEATURE_APTCMD="
echo \"deb http://alexandria.pb.local/dev-repository $DISTRIBUTION main contrib non-free\" \
> /etc/apt/sources.list.d/profitbricks-linux-image-storage-$DISTRIBUTION.list