]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
make target rsync depend on LIVE_TYPE
authorMathias Klette <mathias.klette@profitbricks.com>
Mon, 25 Jun 2012 16:46:11 +0000 (18:46 +0200)
committerMathias Klette <mathias.klette@profitbricks.com>
Mon, 25 Jun 2012 16:46:11 +0000 (18:46 +0200)
live_build.sh

index 084740d3efa16b67bd993af4d74a2389649e3ad8..4ddd33b5c97ec5932edf67c49162da2ef7fa666e 100755 (executable)
@@ -4,16 +4,26 @@
 set -e
 
 if [ "$1" == "" ] ; then
-       export LIVE_TYPE="staging"
+       LIVE_TYPE="staging"
 else
-       export LIVE_TYPE=$1
+       LIVE_TYPE=$1
 fi
 
+case $LIVE_TYPE in 
+    default|staging)
+        TARGET_RSYNC="livebuild@10.1.1.1/livebuild/"
+        ;;
+    pbb)
+        TARGET_RSYNC="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 BUILD_ID="${LIVE_TYPE}-${BUILDDATE}-${BUILD_NUMBER}"            # BUILD_ID is used without lb_build.sh...
-BUILD_TARGET=$TARGET_BASE/$BUILD_ID
+export LIVE_TYPE TARGET_RSYNC BUILDDATE BUILD_ID BUILD_TARGET TARGET_BASE
 
 figlet "building $LIVE_TYPE with build_id $BUILD_ID"
 
@@ -36,8 +46,8 @@ figlet "success"
 echo
 sort binary/live/filesystem.packages
 echo
-echo "Now rsyncing results to mgmt1..."
-rsync --password-file /etc/rsynclivebuild-send.pass -avv --delete $TARGET_BASE/ rsync://livebuild@10.1.1.1/livebuild/
+echo "Now rsyncing results to $TARGET_RSYNC ..."
+rsync --password-file /etc/rsynclivebuild-send.pass -avv --delete $TARGET_BASE/ rsync://$TARGET_RSYNC
 
 figlet "rsync success"