[cc2b3c2] | 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" |
---|
[b32e00f] | 9 | # Amount of virtual memory and virtual CPUs. |
---|
[cc2b3c2] | 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" |
---|
[d908628] | 16 | dnf install -y glibc-locale-source glibc-langpack-${LANG%_*} |
---|
[a0f197e] | 17 | localedef -v -c -i ${LANG%.*} -f UTF-8 $LANG 2>/dev/null |
---|
| 18 | localectl set-locale LANG=$LANG |
---|
| 19 | localectl set-keymap ${LANG%_*} |
---|
| 20 | localectl set-x11-keymap ${LANG%_*} |
---|
[cc2b3c2] | 21 | # Update repositories. |
---|
[a0f197e] | 22 | dnf install -y http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm |
---|
[cc2b3c2] | 23 | # Install main dependencies. |
---|
[d908628] | 24 | dnf install -y debhelper dpkg-dev pyqt4-devel rpm-build subversion samba-winbind wine.i686 mingw32-wine-gecko wine-mono cabextract |
---|
[cc2b3c2] | 25 | # Install desktop (XFCE) and GUI utils. |
---|
[6129d4a] | 26 | dnf install -y @xfce-desktop-environment firefox VirtualBox-guest kmod-VirtualBox akmod-VirtualBox akmods |
---|
[d908628] | 27 | systemctl set-default graphical.target |
---|
[a0f197e] | 28 | sed -i '$d' /usr/lib/udev/rules.d/60-vboxguest.rules |
---|
| 29 | akmods && systemctl restart systemd-modules-load.service |
---|
[d908628] | 30 | # Install ATOM editor by default (less disk space). |
---|
| 31 | wget -q https://atom.io/download/rpm -O /tmp/atom.rpm && dnf install -y /tmp/atom.rpm && rm -f /tmp/atom.rpm |
---|
[b32e00f] | 32 | # Comment out next line if you prefer to install Eclipse IDE for Python (it needs more disk space). |
---|
[d908628] | 33 | #dnf install -y eclipse-pydev eclipse-nls-${LANG%_*} |
---|
[cc2b3c2] | 34 | # Download OGAgent environment installer. |
---|
[c3e7c06] | 35 | svn export http://opengnsys.es/svn/branches/version1.1/installer/ogagent-devel-installer.sh /home/vagrant |
---|
[cc2b3c2] | 36 | # Instructions. |
---|
| 37 | echo "Manual operations:" |
---|
[6129d4a] | 38 | echo "- Reboot VM or launch desktop: startxfce4 &" |
---|
[cc2b3c2] | 39 | echo "- Enlarge VM window." |
---|
| 40 | echo "- To prepare OGAgent environment, execute: ./ogagent-devel-installer.sh" |
---|
[d908628] | 41 | echo "- If you use the default Atom IDE:" |
---|
| 42 | echo " - Open a Project located in /home/vagrant/ogagent/src directory." |
---|
| 43 | echo "- Only if you enable Eclipse IDE installation, you need to configure it before coding:" |
---|
[cc2b3c2] | 44 | echo " - Set Python interpreter on Preferences/PyDev/Interpreters/Python Interpreter." |
---|
[a0f197e] | 45 | echo " - Create a new PyDev Project located in /home/vagrant/ogagent/src directory." |
---|
[cc2b3c2] | 46 | EOT |
---|
| 47 | |
---|
| 48 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
---|
| 49 | |
---|
| 50 | # OpenGnsys boot-tools environment VM definition. |
---|
| 51 | config.vm.define "ogAgent" do |ag| |
---|
[d908628] | 52 | ag.ssh.insert_key = false |
---|
[cc2b3c2] | 53 | # Specific VirtualBox configuration. |
---|
| 54 | ag.vm.provider "virtualbox" do |vb| |
---|
| 55 | # VM name, memory and CPUs. |
---|
| 56 | vb.name = "ogAgent" |
---|
| 57 | vb.memory = VMMEM |
---|
| 58 | vb.cpus = VMCPUS |
---|
| 59 | vb.gui = true |
---|
| 60 | end |
---|
| 61 | # VM base and host name. |
---|
[d908628] | 62 | ag.vm.box = "fedora/24-cloud-base" |
---|
[cc2b3c2] | 63 | ag.vm.hostname = "ogAgent" |
---|
[b32e00f] | 64 | # Comment out to disable synced folder. |
---|
[6129d4a] | 65 | #ag.vm.synced_folder ".", "/vagrant", disabled: true |
---|
[cc2b3c2] | 66 | # Launch provisioning script. |
---|
| 67 | ag.vm.provision "shell", inline: SCRIPT |
---|
| 68 | end |
---|
| 69 | |
---|
| 70 | end |
---|
| 71 | |
---|