From cc2b3c20e8263422c705ba01467dabd20cdd9703 Mon Sep 17 00:00:00 2001 From: ramon Date: Fri, 1 Apr 2016 11:10:26 +0000 Subject: #718 #739: Fichero Vagrant para instalar y configurar el entorno de desarrollo de agentes OGAgent. git-svn-id: https://opengnsys.es/svn/branches/version1.1@4858 a21b9725-9963-47de-94b9-378ad31fedc9 --- installer/vagrant/Vagrantfile-ogagent-vbox | 86 ++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 installer/vagrant/Vagrantfile-ogagent-vbox (limited to 'installer/vagrant/Vagrantfile-ogagent-vbox') diff --git a/installer/vagrant/Vagrantfile-ogagent-vbox b/installer/vagrant/Vagrantfile-ogagent-vbox new file mode 100644 index 00000000..0b354bb7 --- /dev/null +++ b/installer/vagrant/Vagrantfile-ogagent-vbox @@ -0,0 +1,86 @@ +# 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 +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 +# Download OGAgent environment installer. +svn export http://opengnsys.es/svn/branches/version1.1-tickets/OGAgent-ticket718/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 + -- cgit v1.2.3-18-g5258