1 | # Vagrantfile to prepare virtual environment using VirtualBox provider to develop OGAgent. |
---|
2 | |
---|
3 | VAGRANTFILE_API_VERSION = "2" |
---|
4 | # VM provider: Oracle VM VirtualBox. |
---|
5 | ENV['VAGRANT_DEFAULT_PROVIDER'] = "virtualbox" |
---|
6 | # Language. |
---|
7 | LANGUAGE = "es_ES" |
---|
8 | ENV['LC_ALL'] = LANGUAGE + ".UTF-8" |
---|
9 | # Amount of memory VM. |
---|
10 | VMMEM = 4096 |
---|
11 | VMCPUS = 4 |
---|
12 | # OpenGnsys boot-tools environment provisioning script. |
---|
13 | SCRIPT = <<EOT |
---|
14 | # Set language. |
---|
15 | export LANG="#{LANGUAGE}.UTF-8" |
---|
16 | localedef -v -c -i ${LANG%.*} -f UTF-8 $LANG 2>/dev/null |
---|
17 | localectl set-locale LANG=$LANG |
---|
18 | localectl set-keymap ${LANG%_*} |
---|
19 | localectl set-x11-keymap ${LANG%_*} |
---|
20 | # Update repositories. |
---|
21 | dnf install -y http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm |
---|
22 | # Install main dependencies. |
---|
23 | 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 |
---|
24 | # Install desktop (XFCE) and GUI utils. |
---|
25 | dnf install -y @xfce-desktop-environment firefox VirtualBox-guest kmod-VirtualBox akmod-VirtualBox akmods |
---|
26 | ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target |
---|
27 | sed -i '$d' /usr/lib/udev/rules.d/60-vboxguest.rules |
---|
28 | akmods && systemctl restart systemd-modules-load.service |
---|
29 | # Install Eclipse IDE for Python (it needs some disk space). |
---|
30 | dnf install -y eclipse-pydev eclipse-nls-${LANG%_*} |
---|
31 | # Comment out next line if you prefer to install ATOM editor. |
---|
32 | #wget -q https://atom.io/download/rpm -O /tmp/atom.rpm && dnf install -y /tmp/atom.rpm && rm -f /tmp/atom.rpm |
---|
33 | # Download OGAgent environment installer. |
---|
34 | svn export http://opengnsys.es/svn/branches/version1.1/installer/ogagent-devel-installer.sh /home/vagrant |
---|
35 | # Instructions. |
---|
36 | echo "Manual operations:" |
---|
37 | echo "- Reboot VM or launch desktop: startxfce4 &" |
---|
38 | echo "- Enlarge VM window." |
---|
39 | echo "- To prepare OGAgent environment, execute: ./ogagent-devel-installer.sh" |
---|
40 | echo "- Before modify OGAgent code, configure Eclipse:" |
---|
41 | echo " - Set Python interpreter on Preferences/PyDev/Interpreters/Python Interpreter." |
---|
42 | echo " - Create a new PyDev Project located in /home/vagrant/ogagent/src directory." |
---|
43 | EOT |
---|
44 | |
---|
45 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
---|
46 | |
---|
47 | # OpenGnsys boot-tools environment VM definition. |
---|
48 | config.vm.define "ogAgent" do |ag| |
---|
49 | # Specific VirtualBox configuration. |
---|
50 | ag.vm.provider "virtualbox" do |vb| |
---|
51 | # VM name, memory and CPUs. |
---|
52 | vb.name = "ogAgent" |
---|
53 | vb.memory = VMMEM |
---|
54 | vb.cpus = VMCPUS |
---|
55 | vb.gui = true |
---|
56 | end |
---|
57 | # VM base and host name. |
---|
58 | ag.vm.box = "fedora/23-cloud-base" |
---|
59 | ag.vm.hostname = "ogAgent" |
---|
60 | # Comment out if you want to disable synced folder. |
---|
61 | #ag.vm.synced_folder ".", "/vagrant", disabled: true |
---|
62 | # Launch provisioning script. |
---|
63 | ag.vm.provision "shell", inline: SCRIPT |
---|
64 | end |
---|
65 | |
---|
66 | end |
---|
67 | |
---|