summaryrefslogtreecommitdiffstats
path: root/installer/vagrant/Vagrantfile-ogagent-vbox
blob: 4f6cf605da3b0275418fd9f413dbca09832ab4cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# 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 = <<EOT
# Set language.
export LANG="#{LANGUAGE}.UTF-8"
localedef -v -c -i ${LANG%.*} -f UTF-8 $LANG 2>/dev/null
localectl set-locale LANG=$LANG
localectl set-keymap ${LANG%_*}
localectl set-x11-keymap ${LANG%_*}
# Update repositories.
dnf install -y http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
# Install main dependencies.
dnf install -y kernel-devel-$(uname -r) debhelper dpkg-dev pyqt4-devel rpm-build subversion samba-winbind wine.i686 mingw32-wine-gecko wine-mono cabextract
# Install desktop (XFCE) and GUI utils.
dnf install -y @xfce-desktop-environment firefox VirtualBox-guest kmod-VirtualBox akmod-VirtualBox akmods
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target 
sed -i '$d' /usr/lib/udev/rules.d/60-vboxguest.rules
akmods && systemctl restart systemd-modules-load.service
# Install Eclipse IDE for Python (it needs some disk space).
dnf install -y eclipse-pydev eclipse-nls-${LANG%_*}
# Comment out next line if you prefer to install ATOM editor.
#wget -q https://atom.io/download/rpm -O /tmp/atom.rpm && dnf install -y /tmp/atom.rpm && rm -f /tmp/atom.rpm
# 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 "- Reboot VM or 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 "  - Set Python interpreter on Preferences/PyDev/Interpreters/Python Interpreter."
echo "  - Create a new PyDev Project located in /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 = "fedora/23-cloud-base"
    ag.vm.hostname = "ogAgent"
    # Comment out if you want to disable synced folder.
    #ag.vm.synced_folder ".", "/vagrant", disabled: true
    # Launch provisioning script.
    ag.vm.provision "shell", inline: SCRIPT
  end

end