Vagrant SOCI

Vagrant used to build and provision virtual environments for hassle-free SOCI development.

Features

Prerequisites

SOCI DB2 backend

The soci.vm will be configured properly to build the DB2 backend only if it is provisioned with complete DB2 CLI client (libraries and headers). You need to download "IBM Data Server Driver Package (DS Driver)" manually and make it visible to Vagrant:

  1. Go to IBM Data Server Client Packages.
  2. Download "IBM Data Server Driver Package (DS Driver)".
  3. Copy the package to ${SOCI_HOME}/tmp directory, on host machine.

Usage

Below, simple and easy development workflow with Vagrant is outlined:

vagrant up

or boot VMs selectively:

vagrant up {soci|db2}

First time you run it, be patient as Vagrant downloads VM box and provisions it installing all the necessary packages.

vagrant ssh {soci|db2}
cd /vagrant # aka $SOCI_HOME
git pull origin master
vagrant ssh soci
cd /vagrant    # aka $SOCI_HOME
cd soci-build  # aka $SOCI_BUILD
make

You can also execute the build.h script provided to run CMake and make

vagrant ssh soci
cd $SOCI_BUILD
/vagrant/scripts/vagrant/build.sh
vagrant {suspend|halt|destroy} {soci|db2}

Check Vagrant command-line interface for complete list of commands.

Environment variables

All variables available to the vagrant user on the VMs are defined in and sourced from /vagrant/scripts/vagrant/common.env:

Note, those variables are also used by provision scripts to set up databases.

Troubleshooting