# Vagrantfile to prepare virtual environment using VirtualBox provider to develop OGAgent. VAGRANTFILE_API_VERSION = "2" # VM provider: Oracle VM VirtualBox. ENV['VAGRANT_DEFAULT_PROVIDER'] = "virtualbox" # Language. LANGUAGE = "es_ES" ENV['LC_ALL'] = LANGUAGE + ".UTF-8" # Amount of memory VM. VMMEM = 4096 VMCPUS = 4 # OpenGnsys boot-tools environment provisioning script. SCRIPT = < /etc/default/locale echo "LANG=\"$LANG\"" >> /etc/environment echo "LANGUAGE=\"$LANG\"" >> /etc/environment echo "LC_ALL=\"$LANG\"" >> /etc/environment echo "LC_CTYPE=\"$LANG\"" >> /etc/environment locale-gen --lang #{LANGUAGE} sed -i "s/XKBLAYOUT=.*/XKBLAYOUT=\"${LANG%_*}\"/" /etc/default/keyboard # Update repositories. add-apt-repository -y ppa:webupd8team/java add-apt-repository -y ppa:ubuntu-wine dpkg --add-architecture i386 apt-get update apt-get -y upgrade # Install main dependencies. apt-get install -y aspell-${LANG%_*} debhelper dpkg-dev pyqt4-dev-tools realpath rpm subversion winbind wine1.8-i386 # Install desktop (XFCE) and GUI utils. apt-get install -y xfce4 gnome-icon-theme-full tango-icon-theme firefox virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11 echo "allowed_users=anybody" > /etc/X11/Xwrapper.config # Install Oracle Java 8. echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections apt-get -y install oracle-java8-installer # Install Eclipse Mars. echo "Downloading Eclipse..." wget -q http://ftp.fau.de/eclipse/technology/epp/downloads/release/mars/2/eclipse-php-mars-2-linux-gtk-x86_64.tar.gz -O /tmp/eclipse-php-mars-2-linux-gtk-x86_64.tar.gz tar -C /opt -xvzf /tmp/eclipse-php-mars-2-linux-gtk-x86_64.tar.gz # Add Eclipse icon to the desktop. mkdir -p /home/vagrant/Escritorio mkdir -p /home/vagrant/Escritorio echo "#!/usr/bin/env xdg-open" > /home/vagrant/Escritorio/eclipse.desktop echo "[Desktop Entry]" >> /home/vagrant/Escritorio/eclipse.desktop echo "Name=Eclipse" >> /home/vagrant/Escritorio/eclipse.desktop echo "Type=Application" >> /home/vagrant/Escritorio/eclipse.desktop echo "Exec=/opt/eclipse/eclipse" >> /home/vagrant/Escritorio/eclipse.desktop echo "Icon=/opt/eclipse/icon.xpm" >> /home/vagrant/Escritorio/eclipse.desktop echo "Terminal=false" >> /home/vagrant/Escritorio/eclipse.desktop chown -R vagrant.vagrant /home/vagrant/Escritorio # Download OGAgent environment installer. svn export http://opengnsys.es/svn/branches/version1.1/installer/ogagent-devel-installer.sh /home/vagrant # Instructions. echo "Manual operations:" echo "- Launch desktop: startxfce4 &" echo "- Enlarge VM window." echo "- To prepare OGAgent environment, execute: ./ogagent-devel-installer.sh" echo "- Before modify OGAgent code, configure Eclipse:" echo " - Go to Eclipse Marketplace and install PyDev plug-in." echo " - Set Python interpreter on Preferences/PyDev/Interpreters/Python Interpreter." echo " - Create new PyDev Project located on /home/vagrant/ogagent/src directory." EOT Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # OpenGnsys boot-tools environment VM definition. config.vm.define "ogAgent" do |ag| # Specific VirtualBox configuration. ag.vm.provider "virtualbox" do |vb| # VM name, memory and CPUs. vb.name = "ogAgent" vb.memory = VMMEM vb.cpus = VMCPUS vb.gui = true end # VM base and host name. ag.vm.box = "ubuntu/trusty64" ag.vm.hostname = "ogAgent" # Disable synced folder. ag.vm.synced_folder ".", "/vagrant", disabled: true # Launch provisioning script. ag.vm.provision "shell", inline: SCRIPT end end