diff --git a/resources/vagrant/.gitignore b/resources/vagrant/.gitignore new file mode 100644 index 0000000..a977916 --- /dev/null +++ b/resources/vagrant/.gitignore @@ -0,0 +1 @@ +.vagrant/ diff --git a/resources/vagrant/README.md b/resources/vagrant/README.md new file mode 100644 index 0000000..a8bdfbc --- /dev/null +++ b/resources/vagrant/README.md @@ -0,0 +1,10 @@ +# Running Tests With Vagrant + +To run tests using these instructions, you will first need to install +[Vagrant](https://www.vagrantup.com). You should be able to use +[VirtualBox](https://www.virtualbox.org) with each environment. Other providers, +such as VMWare and Hyper-V, may be available, depending on the box used. + +* [Run tests on Linux](linux/README.md) +* [Run tests on FreeBSD](freebsd/README.md) +* [Run tests on Windows](windows/README.md) diff --git a/resources/vagrant/freebsd/README.md b/resources/vagrant/freebsd/README.md new file mode 100644 index 0000000..021e663 --- /dev/null +++ b/resources/vagrant/freebsd/README.md @@ -0,0 +1,15 @@ +# Run tests on FreeBSD + +``` bash +cd /path/to/uuid/resources/vagrant/freebsd +vagrant up +vagrant ssh +``` + +Once inside the VM: + +``` bash +cd uuid/ +composer install +composer run-script --timeout=0 test +``` diff --git a/resources/vagrant/freebsd/Vagrantfile b/resources/vagrant/freebsd/Vagrantfile new file mode 100644 index 0000000..2d692fb --- /dev/null +++ b/resources/vagrant/freebsd/Vagrantfile @@ -0,0 +1,35 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +$script = <<-SCRIPT +pkg update +pkg install -y \ + php74 \ + php74-bcmath \ + php74-composer \ + php74-dom \ + php74-gmp \ + php74-json \ + php74-pecl-libsodium \ + php74-pecl-uuid \ + php74-pecl-xdebug \ + php74-simplexml \ + php74-tokenizer \ + php74-xml \ + php74-xmlreader \ + php74-xmlwriter \ + php74-zip \ + unzip +SCRIPT + +Vagrant.configure("2") do |config| + config.vm.box = "freebsd/FreeBSD-12.1-RELEASE" + config.vm.box_version = "2019.11.01" + config.vm.provision "shell", inline: $script + config.vm.synced_folder "../../../", "/home/vagrant/uuid", type: "rsync" + config.ssh.shell = "sh" + + config.vm.provider "virtualbox" do |v| + v.name = "ramsey-uuid-freebsd" + end +end diff --git a/resources/vagrant/linux/README.md b/resources/vagrant/linux/README.md new file mode 100644 index 0000000..99ef2fd --- /dev/null +++ b/resources/vagrant/linux/README.md @@ -0,0 +1,15 @@ +# Run tests on Linux + +``` bash +cd /path/to/uuid/resources/vagrant/linux +vagrant up +vagrant ssh +``` + +Once inside the VM: + +``` bash +cd uuid/ +composer install +composer run-script --timeout=0 test +``` diff --git a/resources/vagrant/linux/Vagrantfile b/resources/vagrant/linux/Vagrantfile new file mode 100644 index 0000000..296a0d5 --- /dev/null +++ b/resources/vagrant/linux/Vagrantfile @@ -0,0 +1,27 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +$script = <<-SCRIPT +apt-get update +apt-get install -y \ + composer \ + php-bcmath \ + php-cli \ + php-gmp \ + php-json \ + php-uuid \ + php-xdebug \ + php-xml \ + php-zip \ + unzip +SCRIPT + +Vagrant.configure("2") do |config| + config.vm.box = "ubuntu/eoan64" + config.vm.provision "shell", inline: $script + config.vm.synced_folder "../../../", "/home/vagrant/uuid", type: "rsync" + + config.vm.provider "virtualbox" do |v| + v.name = "ramsey-uuid-linux" + end +end diff --git a/resources/vagrant/windows/README.md b/resources/vagrant/windows/README.md new file mode 100644 index 0000000..a778bc4 --- /dev/null +++ b/resources/vagrant/windows/README.md @@ -0,0 +1,15 @@ +# Run tests on Windows + +``` bash +cd /path/to/uuid/resources/vagrant/windows +vagrant up +vagrant ssh +``` + +Once inside the VM: + +``` bash +cd uuid +composer install +composer run-script --timeout=0 test +``` diff --git a/resources/vagrant/windows/Vagrantfile b/resources/vagrant/windows/Vagrantfile new file mode 100644 index 0000000..3ae72f4 --- /dev/null +++ b/resources/vagrant/windows/Vagrantfile @@ -0,0 +1,22 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +$script = <<-SCRIPT +choco install composer php unzip --no-progress -y +Invoke-WebRequest -Uri https://windows.php.net/downloads/pecl/releases/xdebug/2.9.1/php_xdebug-2.9.1-7.4-nts-vc15-x64.zip -UseBasicParsing -OutFile C:\\temp\\php_xdebug.zip +unzip C:\\temp\\php_xdebug.zip -d C:\\temp\\php_xdebug +move C:\\temp\\php_xdebug\\php_xdebug.dll C:\\tools\\php74\\ext\\php_xdebug.dll +Add-Content C:\\tools\\php74\\php.ini "`nextension=gmp" +Add-Content C:\\tools\\php74\\php.ini "`nextension=sodium" +Add-Content C:\\tools\\php74\\php.ini "`nzend_extension=xdebug" +SCRIPT + +Vagrant.configure("2") do |config| + config.vm.box = "jborean93/WindowsServer2019" + config.vm.provision "shell", inline: $script + config.vm.synced_folder "../../../", "C:\\Users\\vagrant\\uuid" + + config.vm.provider "virtualbox" do |vb| + vb.name = "ramsey-uuid-windows" + end +end