James E. Blair | 92e8199 | 2011-10-11 09:26:29 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Dean Troyer | e62ba4d | 2012-06-27 22:07:34 -0500 | [diff] [blame] | 2 | |
| 3 | # **build_bm.sh** |
| 4 | |
James E. Blair | 92e8199 | 2011-10-11 09:26:29 -0500 | [diff] [blame] | 5 | # Build an OpenStack install on a bare metal machine. |
| 6 | set +x |
| 7 | |
Dean Troyer | 05530ca | 2012-07-06 15:09:10 -0500 | [diff] [blame] | 8 | # Keep track of the current directory |
| 9 | TOOLS_DIR=$(cd $(dirname "$0") && pwd) |
| 10 | TOP_DIR=$(cd $TOOLS_DIR/..; pwd) |
| 11 | |
| 12 | # Import common functions |
| 13 | source $TOP_DIR/functions |
| 14 | |
James E. Blair | 92e8199 | 2011-10-11 09:26:29 -0500 | [diff] [blame] | 15 | # Source params |
| 16 | source ./stackrc |
| 17 | |
| 18 | # Param string to pass to stack.sh. Like "EC2_DMZ_HOST=192.168.1.1 MYSQL_USER=nova" |
| 19 | STACKSH_PARAMS=${STACKSH_PARAMS:-} |
| 20 | |
| 21 | # Option to use the version of devstack on which we are currently working |
| 22 | USE_CURRENT_DEVSTACK=${USE_CURRENT_DEVSTACK:-1} |
| 23 | |
| 24 | # Configure the runner |
| 25 | RUN_SH=`mktemp` |
| 26 | cat > $RUN_SH <<EOF |
| 27 | #!/usr/bin/env bash |
| 28 | # Install and run stack.sh |
| 29 | cd devstack |
| 30 | $STACKSH_PARAMS ./stack.sh |
| 31 | EOF |
| 32 | |
| 33 | # Make the run.sh executable |
| 34 | chmod 755 $RUN_SH |
| 35 | |
| 36 | scp -r . root@$CONTAINER_IP:devstack |
| 37 | scp $RUN_SH root@$CONTAINER_IP:$RUN_SH |
| 38 | ssh root@$CONTAINER_IP $RUN_SH |