From: Holger Levsen Date: Fri, 24 Aug 2012 08:55:32 +0000 (+0200) Subject: prepare syncing to riserver X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=527760f7ac9c54cdc8760324be138befbdc2f220;p=profitbricks%2Fjenkins-build-scripts.git prepare syncing to riserver --- diff --git a/live_build.sh b/live_build.sh index 0c2c873..878c829 100755 --- a/live_build.sh +++ b/live_build.sh @@ -34,7 +34,7 @@ BUILD_TARGET=$RSYNC_BASE/$BUILD_ID 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) diff --git a/liveboot_build.sh b/liveboot_build.sh index 6b11f46..e050734 100755 --- a/liveboot_build.sh +++ b/liveboot_build.sh @@ -10,6 +10,38 @@ export 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) @@ -35,3 +67,27 @@ sudo mv cache .. 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"