]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
further adjustments to only sync last build into pbb
authorMathias Klette <mathias.klette@profitbricks.com>
Tue, 26 Jun 2012 10:42:56 +0000 (12:42 +0200)
committerMathias Klette <mathias.klette@profitbricks.com>
Tue, 26 Jun 2012 10:42:56 +0000 (12:42 +0200)
live_build.sh

index 4ddd33b5c97ec5932edf67c49162da2ef7fa666e..05375e7b354c08474283a74c4d4feafb9a6b4538 100755 (executable)
@@ -9,21 +9,23 @@ else
        LIVE_TYPE=$1
 fi
 
+RSYNC_BASE=/srv/mirror/live-build
+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
+
 case $LIVE_TYPE in 
     default|staging)
-        TARGET_RSYNC="livebuild@10.1.1.1/livebuild/"
+        RSYNC_SRC="$RSYNC_BASE/"
+        RSYNC_DST="livebuild@10.1.1.1/livebuild/"
         ;;
     pbb)
-        TARGET_RSYNC="livebuild@10.254.1.1/livebuild/"
+        RSYNC_SRC="$BUILD_TARGET/"
+        RSYNC_DST="livebuild@10.254.1.1/livebuild/"
         ;;
 esac
 
-BUILDDATE=$(date +%Y%m%d%H%M)
-BUILD_ID="${LIVE_TYPE}-${BUILDDATE}-${BUILD_NUMBER}"           # BUILD_ID is used without lb_build.sh...
-BUILD_TARGET=$TARGET_BASE/$BUILD_ID
-TARGET_BASE=/srv/mirror/live-build
-
-export LIVE_TYPE TARGET_RSYNC BUILDDATE BUILD_ID BUILD_TARGET TARGET_BASE
+export LIVE_TYPE TARGET_RSYNC BUILD_DATE BUILD_ID BUILD_TARGET TARGET_BASE
 
 figlet "building $LIVE_TYPE with build_id $BUILD_ID"
 
@@ -34,7 +36,6 @@ sudo bash ./lb_build.sh -p $LIVE_TYPE
 ls -larth tftpboot/debian-live/amd64/
 ls -larth binary/live/
 
-
 mkdir -p $BUILD_TARGET
 
 echo "Finally copying results..."
@@ -46,8 +47,8 @@ figlet "success"
 echo
 sort binary/live/filesystem.packages
 echo
-echo "Now rsyncing results to $TARGET_RSYNC ..."
-rsync --password-file /etc/rsynclivebuild-send.pass -avv --delete $TARGET_BASE/ rsync://$TARGET_RSYNC
+echo "Now rsyncing results to $RSYNC_BASE ..."
+rsync --password-file /etc/rsynclivebuild-send.pass -avv --delete $RSYNC_SRC/ rsync://$RSYNC_DST
 
 figlet "rsync success"