]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
prepare syncing to riserver
authorHolger Levsen <holger@layer-acht.org>
Fri, 24 Aug 2012 08:55:32 +0000 (10:55 +0200)
committerHolger Levsen <holger@layer-acht.org>
Fri, 24 Aug 2012 08:55:32 +0000 (10:55 +0200)
live_build.sh
liveboot_build.sh

index 0c2c8732130713ea185826d0e1f03874916a6be0..878c82900906e36ba801945b0d15d6622e549287 100755 (executable)
@@ -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)
index 6b11f465449e0560c1f964bd7d52601d5e41e5b9..e050734d3d52869b855d62cb3296d5060f3a8991 100755 (executable)
@@ -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"