Merge "Fix build_uec to properly respect the devstack directory that is used when COPY_ENV=1"

This commit is contained in:
Jenkins 2011-12-30 18:19:53 +00:00 committed by Gerrit Code Review
commit efa97d2c18

View File

@ -185,17 +185,6 @@ cat > $vm_dir/uec/user-data<<EOF
sed -i "s/127.0.0.1/127.0.0.1 \`hostname\`/" /etc/hosts sed -i "s/127.0.0.1/127.0.0.1 \`hostname\`/" /etc/hosts
apt-get update apt-get update
apt-get install git sudo -y apt-get install git sudo -y
if [ ! -d devstack ]; then
git clone https://github.com/cloudbuilders/devstack.git
cd devstack
git remote set-url origin `cd $TOP_DIR; git remote show origin | grep Fetch | awk '{print $3}'`
git fetch
git checkout `git rev-parse HEAD`
cat > localrc <<LOCAL_EOF
ROOTSLEEP=0
`cat $TOP_DIR/localrc`
LOCAL_EOF
fi
# Disable byobu # Disable byobu
sudo apt-get remove -y byobu sudo apt-get remove -y byobu
EOF EOF
@ -205,6 +194,14 @@ if [[ -e ~/.ssh/id_rsa.pub ]]; then
PUB_KEY=`cat ~/.ssh/id_rsa.pub` PUB_KEY=`cat ~/.ssh/id_rsa.pub`
cat >> $vm_dir/uec/user-data<<EOF cat >> $vm_dir/uec/user-data<<EOF
mkdir -p /opt/stack mkdir -p /opt/stack
if [ ! -d /opt/stack/devstack ]; then
git clone https://github.com/cloudbuilders/devstack.git /opt/stack/devstack
cd /opt/stack/devstack
cat > localrc <<LOCAL_EOF
ROOTSLEEP=0
`cat $TOP_DIR/localrc`
LOCAL_EOF
fi
useradd -U -G sudo -s /bin/bash -d /opt/stack -m stack useradd -U -G sudo -s /bin/bash -d /opt/stack -m stack
echo stack:pass | chpasswd echo stack:pass | chpasswd
mkdir -p /opt/stack/.ssh mkdir -p /opt/stack/.ssh
@ -222,7 +219,7 @@ fi
# Run stack.sh # Run stack.sh
cat >> $vm_dir/uec/user-data<<EOF cat >> $vm_dir/uec/user-data<<EOF
./stack.sh su -c "cd /opt/stack/devstack && ./stack.sh" stack
EOF EOF
# (re)start a metadata service # (re)start a metadata service