source: installer/vagrant/Vagrantfile-ogagent-vbox @ 1c9ef24

918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Last change on this file since 1c9ef24 was c3e7c06, checked in by ramon <ramongomez@…>, 9 years ago

#718: Integrar código fuente de agente OGAgent en rama de desarrollo.

git-svn-id: https://opengnsys.es/svn/branches/version1.1@4865 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100644
File size: 3.7 KB
Line 
1# Vagrantfile to prepare virtual environment using VirtualBox provider to develop OGAgent.
2
3VAGRANTFILE_API_VERSION = "2"
4# VM provider: Oracle VM VirtualBox.
5ENV['VAGRANT_DEFAULT_PROVIDER'] = "virtualbox"
6# Language.
7LANGUAGE = "es_ES"
8ENV['LC_ALL'] = LANGUAGE + ".UTF-8"
9# Amount of memory VM.
10VMMEM = 4096
11VMCPUS = 4
12# OpenGnsys boot-tools environment provisioning script.
13SCRIPT = <<EOT
14# Set language.
15export LANG="#{LANGUAGE}.UTF-8"
16echo "LANG=\"$LANG\"" > /etc/default/locale
17echo "LANG=\"$LANG\"" >> /etc/environment
18echo "LANGUAGE=\"$LANG\"" >> /etc/environment
19echo "LC_ALL=\"$LANG\"" >> /etc/environment
20echo "LC_CTYPE=\"$LANG\"" >> /etc/environment
21locale-gen --lang #{LANGUAGE}
22sed -i "s/XKBLAYOUT=.*/XKBLAYOUT=\"${LANG%_*}\"/" /etc/default/keyboard
23# Update repositories.
24add-apt-repository -y ppa:webupd8team/java
25add-apt-repository -y ppa:ubuntu-wine
26dpkg --add-architecture i386
27apt-get update
28apt-get -y upgrade
29# Install main dependencies.
30apt-get install -y aspell-${LANG%_*} debhelper dpkg-dev pyqt4-dev-tools realpath rpm subversion winbind wine1.8-i386
31# Install desktop (XFCE) and GUI utils.
32apt-get install -y xfce4 gnome-icon-theme-full tango-icon-theme firefox virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11
33echo "allowed_users=anybody" > /etc/X11/Xwrapper.config
34# Install Oracle Java 8.
35echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
36echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
37apt-get -y install oracle-java8-installer
38# Install Eclipse Mars.
39echo "Downloading Eclipse..."
40wget -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
41tar -C /opt -xvzf /tmp/eclipse-php-mars-2-linux-gtk-x86_64.tar.gz
42# Add Eclipse icon to the desktop.
43mkdir -p /home/vagrant/Escritorio
44mkdir -p /home/vagrant/Escritorio
45echo "#!/usr/bin/env xdg-open" > /home/vagrant/Escritorio/eclipse.desktop
46echo "[Desktop Entry]" >> /home/vagrant/Escritorio/eclipse.desktop
47echo "Name=Eclipse" >> /home/vagrant/Escritorio/eclipse.desktop
48echo "Type=Application" >> /home/vagrant/Escritorio/eclipse.desktop
49echo "Exec=/opt/eclipse/eclipse" >> /home/vagrant/Escritorio/eclipse.desktop
50echo "Icon=/opt/eclipse/icon.xpm" >> /home/vagrant/Escritorio/eclipse.desktop
51echo "Terminal=false" >> /home/vagrant/Escritorio/eclipse.desktop
52chown -R vagrant.vagrant /home/vagrant/Escritorio
53# Download OGAgent environment installer.
54svn export http://opengnsys.es/svn/branches/version1.1/installer/ogagent-devel-installer.sh /home/vagrant
55# Instructions.
56echo "Manual operations:"
57echo "- Launch desktop: startxfce4 &"
58echo "- Enlarge VM window."
59echo "- To prepare OGAgent environment, execute: ./ogagent-devel-installer.sh"
60echo "- Before modify OGAgent code, configure Eclipse:"
61echo "  - Go to Eclipse Marketplace and install PyDev plug-in."
62echo "  - Set Python interpreter on Preferences/PyDev/Interpreters/Python Interpreter."
63echo "  - Create new PyDev Project located on /home/vagrant/ogagent/src directory."
64EOT
65
66Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
67
68  # OpenGnsys boot-tools environment VM definition.
69  config.vm.define "ogAgent" do |ag|
70    # Specific VirtualBox configuration.
71    ag.vm.provider "virtualbox" do |vb|
72      # VM name, memory and CPUs.
73      vb.name = "ogAgent"
74      vb.memory = VMMEM
75      vb.cpus = VMCPUS
76      vb.gui = true
77    end
78    # VM base and host name.
79    ag.vm.box = "ubuntu/trusty64"
80    ag.vm.hostname = "ogAgent"
81    # Disable synced folder.
82    ag.vm.synced_folder ".", "/vagrant", disabled: true
83    # Launch provisioning script.
84    ag.vm.provision "shell", inline: SCRIPT
85  end
86
87end
88
Note: See TracBrowser for help on using the repository browser.