568183: Vagrant setup for local website test

Change-Id: Idc1957f36966e32d88ad5f215c47b02c0ab80e95
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=568183
Signed-off-by: Frank Becker <eclipse@frank-becker.de>
diff --git a/org.eclipse.mylyn.releng/vagrant/websitetest/Vagrantfile b/org.eclipse.mylyn.releng/vagrant/websitetest/Vagrantfile
new file mode 100644
index 0000000..b47cd22
--- /dev/null
+++ b/org.eclipse.mylyn.releng/vagrant/websitetest/Vagrantfile
@@ -0,0 +1,29 @@
+############ install required plugins ############
+
+unless Vagrant.has_plugin?("vagrant-vbguest")
+  puts 'Installing vagrant-vbguest Plugin...'
+  system('vagrant plugin install vagrant-vbguest')
+end
+ 
+
+############ definitoins ############
+MYLYN_TEST_IP_ADDRESS = "192.168.50.5"
+MYLYN_TEST_NAME = "websitetest.local"
+############ vagrant setup ############
+
+Vagrant.configure("2") do |config|
+  config.vm.synced_folder "../../../../../eclipse.org-common", "/var/www/html/eclipse.org-common"
+  config.vm.synced_folder "../../../../../mylyn"             , "/var/www/html/mylyn"
+
+  config.vm.box = "ubuntu/focal64"
+  config.vm.network "forwarded_port", guest: 80, host: 8080
+  config.vm.network "private_network", ip: MYLYN_TEST_IP_ADDRESS
+  config.vm.hostname = MYLYN_TEST_NAME
+  config.vm.define :websitetest do |t|
+    config.vm.provider "virtualbox" do |vb|
+       vb.name = "Mylyn Website - Test"
+       vb.customize [ "modifyvm", :id, "--uartmode1", "file", File::NULL ]
+    end
+  end 
+  config.vm.provision "shell", :path => "install.sh", :args => "'#{MYLYN_TEST_NAME}'", :run => "always"
+end
\ No newline at end of file
diff --git a/org.eclipse.mylyn.releng/vagrant/websitetest/install.sh b/org.eclipse.mylyn.releng/vagrant/websitetest/install.sh
new file mode 100755
index 0000000..901cbb4
--- /dev/null
+++ b/org.eclipse.mylyn.releng/vagrant/websitetest/install.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+echo "Start install"
+apt-get update
+apt-get install -q -y apache2 mysql-server php php-mysql
+apt-get clean
+echo "End install"
+
+echo "<div class=\"col-sm-24 col-md-24 col-lg-24\">Dummy page.  Update with <a href="contributorupdate.php">contributorupdate.php</a></div>" > /var/www/html/mylyn/contributors/contributor.inc
+# set permissions so that contributorupdate.php can write the file
+chmod  -R 777 /var/www/html/mylyn/contributors
+
+sudo /etc/init.d/apache2 start
\ No newline at end of file