jenkins lxc

  • By marcoceppi
  • Latest version (#0)
  • precise
  • Stable
  • Edge

Description

Support running tests, etc. in LXC


This charm installs the run-in-container script, which can be used to run
arbitrary commands in a freshly-created LXC container, in which
/var/lib/jenkins is bind-mounted and the 'jenkins' user has paswordless sudo.
The container is cloned from jenkins-test-base, which is created on install.
The jenkins user is also tweaked, to enable SSH.

The SSH tweakage requires the jenkins-lander charm to be deployed on the same
instance.

run-in-container takes an instance name as its sole parameter. It accepts a
list of commands on standard input. It is intended to be used with heredocs,
like so:

run-in-container $BUILD_TAG <<EOT
cd $(pwd)
sudo apt-get install -y build-essential
make sysdeps
make check
EOT
sudo lxc-destroy -n $BUILD_TAG -f || true