Skip to content

Commit 4fdcc47

Browse files
authored
Merge pull request #179 from lucab/to-upstream/travis-containers
travis: run whole testsuite in containers
2 parents 0374156 + fd65dcf commit 4fdcc47

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

.travis.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
1-
language: go
2-
go: 1.4
1+
sudo: required
2+
3+
services:
4+
- docker
5+
6+
env:
7+
global:
8+
- GOPATH=/opt
9+
- BUILD_DIR=/opt/src/github.com/coreos/go-systemd
10+
matrix:
11+
- DOCKER_BASE=ubuntu:16.04
12+
- DOCKER_BASE=debian:stretch
13+
14+
before_install:
15+
- docker pull ${DOCKER_BASE}
16+
- 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 && go get github.com/coreos/pkg/dlopen && go get github.com/godbus/dbus"
17+
- docker commit `cat /tmp/cidfile` go-systemd/container-tests
18+
- rm -f /tmp/cidfile
319

420
install:
5-
- go get github.com/godbus/dbus
21+
- docker run -d --cidfile=/tmp/cidfile --privileged -e GOPATH=${GOPATH} -v ${PWD}:${BUILD_DIR} go-systemd/container-tests /bin/systemd --system
622

723
script:
8-
- ./test
24+
- docker exec `cat /tmp/cidfile` /bin/bash -c "cd ${BUILD_DIR} && ./test"
25+
26+
after_script:
27+
- docker kill `cat /tmp/cidfile`

0 commit comments

Comments
 (0)