Support running tests, etc. in LXC
- misc ›
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
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,
run-in-container $BUILD_TAG <<EOT
sudo apt-get install -y build-essential
sudo lxc-destroy -n $BUILD_TAG -f || true