Browse Source

Minor modifications to bootstrap

Hamilton Turner 11 years ago
parent
commit
ca4fdcb337

+ 5 - 1
deployment/vagrant-common/bootstrap.sh

@@ -14,6 +14,10 @@ while read -r line; do
   export $line; 
 done <<< "$1"
 
+# Store any custom variables used at launch, in case someone forgets
+# what this instance is (e.g. SSD or HDD, etc)
+echo "$1" > ~/.tfb_launch_options
+
 # Are we installing the server machine, the client machine, 
 # the database machine, or all machines? 
 # Valid values: 
@@ -98,7 +102,7 @@ if [ ! -e "~/.firstboot" ]; then
     rm -rf $FWROOT/installs $FWROOT/results
   else
     # If there is no synced folder, clone the project
-    echo "Cloning project from TechEmpower/FrameworkBenchmarks master"
+    echo "Cloning project from $GH_REPO $GH_BRANCH"
     git clone -b ${GH_BRANCH} https://github.com/${GH_REPO}.git $FWROOT
   fi
   sudo pip install -r $FWROOT/config/python_requirements.txt

+ 0 - 59
deployment/vagrant-development/bootstrap.sh

@@ -1,59 +0,0 @@
-#!/usr/bin/env bash
-#
-# Prepares a virtual machine for running TFB
-#
-# Intentionally uses ~, $HOME, and $USER so that the 
-# same script can work for VirtualBox (username vagrant)
-# and Amazon (username ubuntu)
-#
-
-if [ ! -e "~/.firstboot" ]; then
-
-  # Setup some nice TFB defaults
-  echo "export TFB_SERVER_HOST=127.0.0.1" >> ~/.bash_profile
-  echo "export TFB_CLIENT_HOST=127.0.0.1" >> ~/.bash_profile
-  echo "export TFB_DATABASE_HOST=127.0.0.1" >> ~/.bash_profile
-  echo "export TFB_CLIENT_USER=$USER" >> ~/.bash_profile
-  echo "export TFB_DATABASE_USER=$USER" >> ~/.bash_profile
-  echo "export TFB_CLIENT_IDENTITY_FILE=$HOME/.ssh/id_rsa" >> ~/.bash_profile
-  echo "export TFB_DATABASE_IDENTITY_FILE=$HOME/.ssh/id_rsa" >> ~/.bash_profile
-  echo "export FWROOT=$HOME/FrameworkBenchmarks" >> ~/.bash_profile 
-  if [ -e "~/FrameworkBenchmarks/benchmark.cfg" ]; then
-    echo "You have a benchmark.cfg file that will interfere with Vagrant, moving to benchmark.cfg.bak"
-    mv ~/FrameworkBenchmarks/benchmark.cfg ~/FrameworkBenchmarks/benchmark.cfg.bak
-  fi
-  source ~/.bash_profile
-
-  # Enable SSH to localhost
-  ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa
-  cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
-  chmod 600 ~/.ssh/authorized_keys
-
-  # Workaround mitchellh/vagrant#289
-  echo "grub-pc grub-pc/install_devices multiselect     /dev/sda" | sudo debconf-set-selections
-  
-  # Install prerequisite tools
-  sudo apt-get install -y git
-  sudo apt-get install -y python-pip
-
-  # Initial project setup
-  if [ -d "/FrameworkBenchmarks" ]; then
-    ln -s /FrameworkBenchmarks $FWROOT
-  else
-    # If there is no synced folder, clone the project
-    git clone https://github.com/TechEmpower/FrameworkBenchmarks.git $FWROOT
-  fi
-  sudo pip install -r $FWROOT/config/python_requirements.txt
-
-  # Setup databases, client workload generator
-  cd $FWROOT
-  toolset/run-tests.py --verbose --install all --test ''
-
-  # Setup a nice welcome message for our guest
-  sudo rm -f /etc/update-motd.d/51-cloudguest
-  sudo rm -f /etc/update-motd.d/98-cloudguest
-  sudo cp /vagrant/custom_motd.sh /etc/update-motd.d/55-tfbwelcome
-
-  touch ~/.firstboot
-fi
-