| Dean Troyer | 608bb12 | 2012-01-10 14:43:17 -0600 | [diff] [blame] | 1 | #!/usr/bin/env bash | 
 | 2 | # | 
| Dean Troyer | e62ba4d | 2012-06-27 22:07:34 -0500 | [diff] [blame] | 3 | # **build_tempest.sh** | 
 | 4 |  | 
 | 5 | # Checkout and prepare a Tempest repo: https://github.com/openstack/tempest.git | 
| Dean Troyer | 608bb12 | 2012-01-10 14:43:17 -0600 | [diff] [blame] | 6 |  | 
 | 7 | function usage { | 
 | 8 |     echo "$0 - Check out and prepare a Tempest repo" | 
 | 9 |     echo "" | 
 | 10 |     echo "Usage: $0" | 
 | 11 |     exit 1 | 
 | 12 | } | 
 | 13 |  | 
 | 14 | if [ "$1" = "-h" ]; then | 
 | 15 |     usage | 
 | 16 | fi | 
 | 17 |  | 
 | 18 | # Clean up any resources that may be in use | 
 | 19 | cleanup() { | 
 | 20 |     set +o errexit | 
 | 21 |  | 
 | 22 |     # Kill ourselves to signal any calling process | 
 | 23 |     trap 2; kill -2 $$ | 
 | 24 | } | 
 | 25 |  | 
 | 26 | trap cleanup SIGHUP SIGINT SIGTERM SIGQUIT EXIT | 
 | 27 |  | 
 | 28 | # Keep track of the current directory | 
 | 29 | TOOLS_DIR=$(cd $(dirname "$0") && pwd) | 
| Dean Troyer | 7f9aa71 | 2012-01-31 12:11:56 -0600 | [diff] [blame] | 30 | TOP_DIR=$(cd $TOOLS_DIR/..; pwd) | 
 | 31 |  | 
 | 32 | # Import common functions | 
 | 33 | . $TOP_DIR/functions | 
| Dean Troyer | 608bb12 | 2012-01-10 14:43:17 -0600 | [diff] [blame] | 34 |  | 
 | 35 | # Abort if localrc is not set | 
 | 36 | if [ ! -e $TOP_DIR/localrc ]; then | 
 | 37 |     echo "You must have a localrc with ALL necessary passwords and configuration defined before proceeding." | 
 | 38 |     echo "See stack.sh for required passwords." | 
 | 39 |     exit 1 | 
 | 40 | fi | 
 | 41 |  | 
 | 42 | # Source params | 
 | 43 | source ./stackrc | 
 | 44 |  | 
 | 45 | # Where Openstack code lives | 
 | 46 | DEST=${DEST:-/opt/stack} | 
 | 47 |  | 
 | 48 | TEMPEST_DIR=$DEST/tempest | 
 | 49 |  | 
| Dean Troyer | 608bb12 | 2012-01-10 14:43:17 -0600 | [diff] [blame] | 50 | # Install tests and prerequisites | 
| Dean Troyer | 608bb12 | 2012-01-10 14:43:17 -0600 | [diff] [blame] | 51 | git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH | 
 | 52 |  | 
 | 53 | trap - SIGHUP SIGINT SIGTERM SIGQUIT EXIT |