diff options
| author | Tim Simpson <tim.simpson@rackspace.com> | 2012-09-04 13:14:55 -0500 |
|---|---|---|
| committer | Tim Simpson <tim.simpson@rackspace.com> | 2012-09-04 13:14:55 -0500 |
| commit | fd35b0f5f2cc3725ffb3df5219ecfe382c6b9a8b (patch) | |
| tree | 3a606b509e67561dd3b7b4e5b5b899a9d42186ef /run_local.sh | |
| parent | 9cee37a6d91c66200025577a31f912b3194bf326 (diff) | |
| download | python-troveclient-fd35b0f5f2cc3725ffb3df5219ecfe382c6b9a8b.tar.gz | |
Adding a script to run the client in CI easier.
Diffstat (limited to 'run_local.sh')
| -rwxr-xr-x | run_local.sh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/run_local.sh b/run_local.sh new file mode 100755 index 0000000..f4953e1 --- /dev/null +++ b/run_local.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +# Specify the path to the RDL repo as argument one. +# Argument 2 cna be a log file for the RDL output. +# This script will create a .pid file and report in the current directory. + +set -e +if [ $# -lt 1 ]; then + echo "Please give the path to the RDL repo as argument one." + exit 5 +else + RDL_PATH=$1 +fi + + +PID_FILE="`pwd`.pid" + +function start_server() { + pushd $RDL_PATH + bin/start_server.sh --pid_file=$PID_FILE + popd +} + +function stop_server() { + if [ -f $PID_FILE ]; + then + pushd $RDL_PATH + bin/stop_server.sh $PID_FILE + popd + else + echo "The pid file did not exist, so not stopping server." + fi +} +function on_error() { + echo "Something went wrong!" + stop_server +} + +trap on_error EXIT # Proceed to trap - END in event of failure. + +start_server +tox +stop_server + + +trap - EXIT +echo "Ran tests successfully. :)" +exit 0 |
