summaryrefslogtreecommitdiffstats
path: root/perf-framework/deploy_gluster
diff options
context:
space:
mode:
authorRahul C S <rahulcs@redhat.com>2012-02-17 17:23:28 +0530
committerRahul C S <rahulcs@redhat.com>2012-02-17 17:24:19 +0530
commitdb468693ef5faa294d9bc3cd3c5d70c0d99d488b (patch)
treef552d0a8e88304dba5038eac670a5c7afe3c267e /perf-framework/deploy_gluster
parent01a77a1ae18d9add01f893e06e58191b065602e8 (diff)
Adding the performance framework to the qa repo
Change-Id: Ia7dbd82e9bb2e5e65e9345234ce34f8518a091ad Signed-off-by: Rahul C S <rahulcs@redhat.com>
Diffstat (limited to 'perf-framework/deploy_gluster')
-rwxr-xr-xperf-framework/deploy_gluster53
1 files changed, 53 insertions, 0 deletions
diff --git a/perf-framework/deploy_gluster b/perf-framework/deploy_gluster
new file mode 100755
index 0000000..49543f7
--- /dev/null
+++ b/perf-framework/deploy_gluster
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+function prepare_server()
+{
+ ip_addr=$1
+ ssh -l root $ip_addr mkdir -p $SERVER_BUILD_DIR
+ scp -p $RELEASE_TARBALL $BUILD_SCRIPT root@$ip_addr:$SERVER_BUILD_DIR
+ ssh -l root $ip_addr "cd $SERVER_BUILD_DIR && tar xf $RELEASE_TARBALL"
+ ssh -l root $ip_addr "cd $SERVER_BUILD_DIR/$release_dir && ../$BUILD_SCRIPT"
+}
+
+function prepare_client()
+{
+ mkdir -p $CLIENT_BUILD_DIR
+ cp $RELEASE_TARBALL $BUILD_SCRIPT $CLIENT_BUILD_DIR
+ cd $CLIENT_BUILD_DIR && tar xf $RELEASE_TARBALL
+ cd $CLIENT_BUILD_DIR/$release_dir && ../$BUILD_SCRIPT
+}
+
+
+CONFIG_FILE=gf_perf_config
+BUILD_SCRIPT=buildit
+source $CONFIG_FILE
+
+if [ "$RELEASE_TARBALL" == "" ]
+then
+ echo "ERROR: Empty release tarball"
+ exit 1
+fi
+
+if [ ! -f $RELEASE_TARBALL ]
+then
+ echo "ERROR: Unable to find source tarball $RELEASE_TARBALL"
+ exit 1
+fi
+
+release_dir=`tar tvf $RELEASE_TARBALL | head -1 | awk '{print $NF}'`
+
+# Build gluster on the bricks
+for brick in `echo $BRICK_IP_ADDRS`
+do
+ echo "Starting build on server $brick..."
+ prepare_server $brick &
+done
+
+echo "Waiting for jobs to finish..."
+sleep 5
+
+# Build gluster on the client
+echo "Starting build on client..."
+prepare_client &
+
+wait