Skip to content

Instantly share code, notes, and snippets.

@ChristopherDavenport
Created March 10, 2016 04:32
Show Gist options
  • Save ChristopherDavenport/06ce417444c0f1ea956b to your computer and use it in GitHub Desktop.
Save ChristopherDavenport/06ce417444c0f1ea956b to your computer and use it in GitHub Desktop.
Test Vagrant for Play Environment
#Vagrantfile AP/sytnax version
VAGRANTFILE_API_VERSION = "2"
$script = <<SCRIPT
yum install -y wget
#JAVA
wget --no-check-certificate --no-cookies --head "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u74-b02/jdk-8u74-linux-x64.rpm
yum localinstall -y jdk-8u74-linux-x64.rpm
rm -f jdk-8u74-linux-x64.rpm
#PLAY
wget https://downloads.typesafe.com/typesafe-activator/1.3.7/typesafe-activator-1.3.7.zip
unzip typesafe-activator-1.3.7.zip -d /tmp
mv /tmp/activator-dist-1.3.7/ /opt
chmod 755 -R /opt/
#Environmental Variables
sudo sh -c "cat > /etc/profile.d/playdev.sh" <<'EOF'
export JAVA_HOME=/usr/java/jdk1.8.0_74
export PATH=${PATH}:${JAVA_HOME}/bin:/opt/activator-dist-1.3.7
EOF
SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "centos/7"
config.vm.network :forwarded_port, guest:9000, host: 8912, auto_correct: true
config.vm.synced_folder "../", "/var/www/" , create: true
config.vm.provider "virtualbox" do |v|
v.name = "Play Framework Centos Vagrant"
v.customize ["modifyvm", :id, "--memory", "1024"]
v.customize ["modifyvm", :id, "--cpuexecutioncap", "75"]
end
config.vm.provision "shell", inline:$script
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment