case $LIVE_TYPE in
default|staging)
RSYNC_SRC="$RSYNC_BASE/"
- RSYNC_DST="livebuild@10.1.1.1/livebuild/"
+ RSYNC_DST="livebuild@10.1.1.1/livebuild/" # mgmt1 will transfer this further, see mgmt1:/etc/rsyncd.conf
RSYNC_FILTER='--include=default-** --include=staging-** --exclude=*'
;;
pbb|pre-staging)
export DIST=squeeze
export PB_SUITE=production-proposed-updates
+#
+# Define default settings
+#
+RSYNC_BASE=/srv/mirror/live-build
+BUILD_DATE=${BUILD_DATE:=$(date +%Y%m%d%H%M)}
+BUILD_ID="${LIVE_TYPE}-${BUILD_DATE}-${BUILD_NUMBER}" # BUILD_ID is used without lb_build.sh...
+BUILD_TARGET=$RSYNC_BASE/$BUILD_ID
+
+
+#
+# Overwrite settings depending on profile used
+# - i.e. not enough space in PBB to contain all images
+#
+#case $LIVE_TYPE in
+# default|staging)
+# RSYNC_SRC="$RSYNC_BASE/"
+# RSYNC_DST="livebuild@10.1.1.1/livebuild/" # mgmt1 will transfer this further, see mgmt1:/etc/rsyncd.conf
+# RSYNC_FILTER='--include=default-** --include=staging-** --exclude=*'
+# ;;
+# pbb|pre-staging)
+# RSYNC_SRC="$BUILD_TARGET/"
+# RSYNC_DST="livebuild@10.254.1.1/livebuild/"
+# RSYNC_FILTER=''
+# ;;
+#esac
+
+# WORK IN PROGRESS
+RSYNC_SRC="$RSYNC_BASE/"
+RSYNC_DST="liveboot@riserver/liveboot/"
+RSYNC_FILTER=''
+
+
figlet "this is work in progress"
BUILD_SCRIPT=$(mktemp)
cd ..
sudo rm liveboot -Rf
+#
+# Mirror
+#
+echo
+echo "Now rsyncing results to $RSYNC_BASE ..."
+rsync --password-file /etc/rsynclivebuild-send.pass -avv --delete --delete-excluded $RSYNC_FILTER $RSYNC_SRC/ rsync://$RSYNC_DST && figlet "mirror OK"
+
+#
+# cleanup /srv/mirror, keep MAX number of images
+#
+#MAX=15
+#cd $RSYNC_BASE
+#COUNT=0
+#for i in $(ls -atd1 ./${LIVE_TYPE}-*) ; do
+# let COUNT=COUNT+1
+# if [ $COUNT -gt $MAX ] ; then
+# rm -rfv $i
+# else
+# echo "keeping $i"
+# fi
+#done
+
+#figlet "cleanup OK"
+echo "cleanup DISABLED"