Create run.sh

This commit is contained in:
Dean Troyer 2011-10-11 20:22:23 -05:00
parent 5611951aef
commit 8f851e716e

View file

@ -18,6 +18,9 @@ CWD=`pwd`
DEST=${DEST:-/opt/stack} DEST=${DEST:-/opt/stack}
# Param string to pass to stack.sh. Like "EC2_DMZ_HOST=192.168.1.1 MYSQL_USER=nova"
STACKSH_PARAMS=${STACKSH_PARAMS:-}
# Option to use the version of devstack on which we are currently working # Option to use the version of devstack on which we are currently working
USE_CURRENT_DEVSTACK=${USE_CURRENT_DEVSTACK:-1} USE_CURRENT_DEVSTACK=${USE_CURRENT_DEVSTACK:-1}
@ -112,6 +115,29 @@ auto eth0
iface eth0 inet dhcp iface eth0 inet dhcp
EOF EOF
# Configure the runner
RUN_SH=$CHROOTCACHE/natty-stack/$DEST/run.sh
cat > $RUN_SH <<EOF
#!/usr/bin/env bash
# Pre-empt download of natty image
tar czf $DEST/devstack/files/natty.tgz /etc/hosts
touch $DEST/devstack/files/images/natty-server-cloudimg-amd64-vmlinuz-virtual
touch $DEST/devstack/files/images/natty-server-cloudimg-amd64.img
# Kill any existing screens
killall screen
# Run stack.sh
cd $DEST/devstack && \$STACKSH_PARAMS ./stack.sh > $DEST/run.sh.log
echo >> $DEST/run.sh.log
echo >> $DEST/run.sh.log
echo "All done! Time to start clicking." >> $DEST/run.sh.log
EOF
# Make the run.sh executable
chmod 755 $RUN_SH
# build a new image # build a new image
BASE=$CHROOTCACHE/build.$$ BASE=$CHROOTCACHE/build.$$
IMG=$BASE.img IMG=$BASE.img