forked from clearlinux/clr-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
58 lines (48 loc) · 2.56 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
sudo: required
env:
- DOCKER_USER=travis
services:
- docker
# This is just here for Travis CI to report correctly
language: go
go:
- "1.10" # quote this or 1.10 is treated as 1.1 (floating point number)
# Not need as we are not running GO in this image, but the Docker image
# go_import_path: github.com/clearlinux/clr-installer
before_install:
- docker pull clearlinux/clr-installer-ci
- docker run --network=host --name clear-test -v $(pwd):/travis -v /dev:/dev -v /var/tmp/test:/tmp -v /sys/fs/cgroup:/sys/fs/cgroup:ro -e container=docker --privileged --tmpfs /run --tmpfs /run/lock -dit --rm clearlinux/clr-installer-ci:latest /sbin/init
- docker ps
# Do NOT use -l (login) for the bash shell or the default profile
# (/usr/share/defaults/etc/profile) will reset PATH removing the
# GOPATH/bin added to the clr-installer-ci Docker image.
# Just use the latest Docker image build for nwo
#install:
# - docker exec -it clear-test bash -c "swupd update"
before_script:
# create a non-root user mapping the travis user (using same uid)
- docker exec -it clear-test bash -c "useradd -u $(id --u) $DOCKER_USER"
# Show the current swupd configuration
- docker exec -it clear-test bash -c "swupd info"
# Debug information
- docker exec -it clear-test bash -c "set;printenv"
# Force restart telemetry
- docker exec -it clear-test bash -c "telemctl restart"
# Debug information to verify restart
- docker exec -it clear-test bash -c "journalctl|cat"
script:
- docker exec -it clear-test bash -c "cd /travis ; make dist-clean"
- docker exec -it clear-test bash -c "cd /travis ; make"
- docker exec -it clear-test bash -c "cd /travis ; PATH=${PATH}:${GOPATH}:/go/bin make vendor-check"
- docker exec -it clear-test bash -c "cd /travis ; make lint"
- travis_retry docker exec -it clear-test bash -c "cd /travis ; make check"
- docker exec -it clear-test bash -c "cd /travis ; make clean"
- docker exec -it clear-test bash -c "cd /travis ; make check-clean"
- docker exec -it clear-test bash -c "chown -R travis:travis /travis"
- docker exec --user "${DOCKER_USER}" -it clear-test bash -c "cd /travis ; make"
- travis_retry docker exec --user "${DOCKER_USER}" -it clear-test bash -c "cd /travis ; ./tests/check-coverage.sh"
- docker exec -it clear-test bash -c "mkdir -p /opt/test-dest"
- docker exec -it clear-test bash -c "cd /travis ; make install DESTDIR=/opt/test-dest"
after_script:
- docker exec -it clear-test bash -c "cd /travis ; make clean"
- docker container stop clear-test