Просмотр исходного кода

Begin preparing the vagrant files for the meganuke branch

Alex Schneider 10 лет назад
Родитель
Сommit
e6054cc4fd
2 измененных файлов с 11 добавлено и 3 удалено
  1. 9 1
      deployment/vagrant-common/bootstrap.sh
  2. 2 2
      deployment/vagrant-common/core.rb

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

@@ -74,6 +74,10 @@ if [ ! -e "~/.firstboot" ]; then
   echo $CLIENT_IP TFB-client   | sudo tee --append /etc/hosts
   echo $SERVER_IP TFB-server   | sudo tee --append /etc/hosts
 
+  # Add other users:
+  sudo useradd -m testrunner
+  sudo bash -c "echo 'testrunner ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/90-tfb-testrunner"
+
   # Update hostname to reflect our current role
   if [ "$ROLE" != "all" ]; then
     echo "Updating hostname"
@@ -112,8 +116,12 @@ if [ ! -e "~/.firstboot" ]; then
   echo "Setting up SSH access to localhost"
   ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa
   cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
+  sudo -u testrunner mkdir -p /home/testrunner/.ssh
+  sudo -u testrunner ssh-keygen -t rsa -N '' -f /home/testrunner/.ssh/id_rsa
+  sudo -u testrunner bash -c "cat /home/testrunner/.ssh/id_rsa.pub >> /home/testrunner/.ssh/authorized_keys"
+  sudo -u testrunner bash -c "cat /home/vagrant/.ssh/authorized_keys >> /home/testrunner/.ssh/authorized_keys"
   chmod 600 ~/.ssh/authorized_keys
-
+  sudo -u testrunner chmod 600 /home/testrunner/.ssh/authorized_keys
   # Enable remote SSH access if we are running production environment
   # Note : this are always copied from the local working copy using a
   #        file provisioner. While they exist in the git clone we just 

+ 2 - 2
deployment/vagrant-common/core.rb

@@ -96,10 +96,10 @@ def provider_virtualbox(config, role)
     vb.memory = ENV.fetch('TFB_VB_MEM', 2048)
     vb.cpus = ENV.fetch('TFB_VB_CPU', 2)
 
-    override.vm.synced_folder "../..", "/FrameworkBenchmarks"
+    override.vm.synced_folder "../..", "/FrameworkBenchmarks", mount_options: ['fmode=777', 'dmode=777']
 
     if role.eql? "all" or role.eql? "app"
       override.vm.network :forwarded_port, guest: 8080, host: 28080
     end
   end
-end
+end