1language: shell # We do everything inside Docker and don't want travis fiddling with steps or environment variables 2 3sudo: required 4 5services: 6 - docker 7 8env: 9 global: 10 - GOPATH=/opt 11 - BUILD_DIR=/opt/src/github.com/coreos/go-systemd 12 matrix: 13 - DOCKER_BASE=ubuntu:16.04 14 - DOCKER_BASE=debian:stretch 15 16before_install: 17 - docker pull ${DOCKER_BASE} 18 - docker run --privileged -e GOPATH=${GOPATH} --cidfile=/tmp/cidfile ${DOCKER_BASE} /bin/bash -c "apt-get update && apt-get install -y build-essential git golang dbus libsystemd-dev libpam-systemd systemd-container && go get github.com/coreos/pkg/dlopen && go get github.com/godbus/dbus" 19 - docker commit `cat /tmp/cidfile` go-systemd/container-tests 20 - rm -f /tmp/cidfile 21 22install: 23 - docker run -d --cidfile=/tmp/cidfile --privileged -e GOPATH=${GOPATH} -v ${PWD}:${BUILD_DIR} go-systemd/container-tests /bin/systemd --system 24 25script: 26 - docker exec `cat /tmp/cidfile` /bin/bash -c "cd ${BUILD_DIR} && ./test" 27 28after_script: 29 - docker kill `cat /tmp/cidfile` 30