diff --git a/scripts/vagrant/.gitignore b/scripts/vagrant/debian/jessie64/.gitignore similarity index 100% rename from scripts/vagrant/.gitignore rename to scripts/vagrant/debian/jessie64/.gitignore diff --git a/scripts/vagrant/README.md b/scripts/vagrant/debian/jessie64/README.md similarity index 100% rename from scripts/vagrant/README.md rename to scripts/vagrant/debian/jessie64/README.md diff --git a/scripts/vagrant/Vagrantfile b/scripts/vagrant/debian/jessie64/Vagrantfile similarity index 100% rename from scripts/vagrant/Vagrantfile rename to scripts/vagrant/debian/jessie64/Vagrantfile diff --git a/scripts/vagrant/buildelektra.sh b/scripts/vagrant/debian/jessie64/buildelektra.sh similarity index 100% rename from scripts/vagrant/buildelektra.sh rename to scripts/vagrant/debian/jessie64/buildelektra.sh diff --git a/scripts/vagrant/provision.sh b/scripts/vagrant/debian/jessie64/provision.sh similarity index 100% rename from scripts/vagrant/provision.sh rename to scripts/vagrant/debian/jessie64/provision.sh diff --git a/scripts/vagrant/ubuntu/artful32/README.md b/scripts/vagrant/ubuntu/artful32/README.md new file mode 100644 index 00000000000..d6878643297 --- /dev/null +++ b/scripts/vagrant/ubuntu/artful32/README.md @@ -0,0 +1,48 @@ +# Trying out Elektra with Vagrant +This Vagrantfile provisions a machine based on ubuntu/artful32 with all tools to build Elektra. + +If [Vagrant](https://www.vagrantup.com/) is installed on your machine change to the directory containing the file you are currently reading and build a box for vagrant with +```sh +$ vagrant up +``` +This will take some time. + +When the machine is running, access it with +```sh +$ vagrant ssh +``` +In this SSH session you can interact with the machine. + +By default Vagrant synchronizes the folder on the host machine containing the vagrantfile with the folder `/vagrant` in the VM. +Therefore we will build a .deb package of Elektra in this folder. + +```sh +# add build directory & cd to it +$ mkdir /vagrant/build +$ cd /vagrant/build + +# some exports to keep everything in the build directory +$ export INSTALL_DIR="$PWD/install" +$ export SYSTEM_DIR="$PWD/kdbsystem" +$ export PATH=$PATH:"$PWD/bin" +$ export LD_LIBRARY_PATH="$PWD/lib" +$ export GTEST_ROOT="/opt/gtest" + + +# configure +$ cmake -DENABLE_COVERAGE=OFF -DENABLE_OPTIMIZATIONS=OFF -DENABLE_DEBUG=ON -DENABLE_LOGGER=ON -DBUILD_STATIC=OFF -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" -DKDB_DB_SYSTEM="$SYSTEM_DIR" -DINSTALL_SYSTEM_FILES=OFF -DPLUGINS="ALL" -DTOOLS="ALL" .. + +# build +$ make -j4 + +# run Elektra's test suite +$ make run_all + +# run the memory checks with valgrind +$ make run_memcheck +``` + +When you are done leave the VM with `CTRL-D` or `exit`. + +You can either shut the VM down with `vagrant halt` or delete it with `vagrant destroy`. + diff --git a/scripts/vagrant/ubuntu/artful32/Vagrantfile b/scripts/vagrant/ubuntu/artful32/Vagrantfile new file mode 100644 index 00000000000..a6fa67e76f8 --- /dev/null +++ b/scripts/vagrant/ubuntu/artful32/Vagrantfile @@ -0,0 +1,97 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# All Vagrant configuration is done below. The "2" in Vagrant.configure +# configures the configuration version (we support older styles for +# backwards compatibility). Please don't change it unless you know what +# you're doing. +Vagrant.configure("2") do |config| + # The most common configuration options are documented and commented below. + # For a complete reference, please see the online documentation at + # https://docs.vagrantup.com. + + # Every Vagrant development environment requires a box. You can search for + # boxes at https://atlas.hashicorp.com/search + config.vm.box = "ubuntu/artful32" + + # Disable automatic box update checking. If you disable this, then + # boxes will only be checked for updates when the user runs + # `vagrant box outdated`. This is not recommended. + # config.vm.box_check_update = false + + # Create a forwarded port mapping which allows access to a specific port + # within the machine from a port on the host machine. In the example below, + # accessing "localhost:8080" will access port 80 on the guest machine. + # config.vm.network "forwarded_port", guest: 80, host: 8080 + + # Create a private network, which allows host-only access to the machine + # using a specific IP. + config.vm.network "private_network", type: "dhcp", nic_type: "virtio" + #config.vm.synced_folder '.', '/vagrant', nfs: true + #config.vm.synced_folder ".", "/vagrant", + # nfs: true, + # nfs_version: 3, + # nfs_udp: false + # Create a public network, which generally matched to bridged network. + # Bridged networks make the machine appear as another physical device on + # your network. + # config.vm.network "public_network" + + # Share an additional folder to the guest VM. The first argument is + # the path on the host to the actual folder. The second argument is + # the path on the guest to mount the folder. And the optional third + # argument is a set of non-required options. + config.vm.synced_folder "../..", "/vagrant", type: "rsync", rsync__exclude: ".git/" + + # Provider-specific configuration so you can fine-tune various + # backing providers for Vagrant. These expose provider-specific options. + # Example for VirtualBox: + # + config.vm.provider "virtualbox" do |vb| + vb.memory = "4096" + vb.cpus = "4" + vb.customize ["modifyvm", :id, "--ioapic", "on"] + #vb.customize [ + # "storagectl", :id, + # "--name", "SATA Controller", + # "--hostiocache", "on" + # ] + # vb.customize ["modifyvm", :id, "--chipset", "ich9"] + # # Display the VirtualBox GUI when booting the machine + # vb.gui = true + # + # # Customize the amount of memory on the VM: + # vb.memory = "1024" + end + # + # View the documentation for the provider you are using for more + # information on available options. + + # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies + # such as FTP and Heroku are also available. See the documentation at + # https://docs.vagrantup.com/v2/push/atlas.html for more information. + # config.push.define "atlas" do |push| + # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" + # end + + # Enable provisioning with a shell script. Additional provisioners such as + # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the + # documentation for more information about their specific syntax and use. + config.vm.provision "shell", inline: <<-SHELL + apt-get update + apt-get -y upgrade + #apt-get -y install linux-image-amd64 linux-headers-amd64 + apt-get -y install curl build-essential autotools-dev automake cmake pkg-config doxygen graphviz bison ruby-dev python-dev python3-dev liblua5.2-dev tclcl-dev libaugeas-dev libyajl-dev libgit2-dev libboost-all-dev libssl-dev libcurl4-gnutls-dev libdbus-1-dev libpcre3-dev libpcre++-dev checkinstall vim valgrind clang-5.0 clang-format-5.0 htop zlib1g-dev git openjdk-8-jdk python-pip locales bison libpython3-dev liblua5.3-dev libxerces-c-dev swig + + pip install --upgrade cmake_format==0.4.1 pyyaml + + mkdir -p /opt/gtest \ + && cd /tmp \ + && curl -o gtest.tar.gz \ + -L https://github.com/google/googletest/archive/4e4df226fc197c0dda6e37f5c8c3845ca1e73a49.tar.gz \ + && tar -zxvf gtest.tar.gz --strip-components=1 -C /opt/gtest \ + && rm gtest.tar.gz + + SHELL +end +