forked from plus3it/nessus-agent-formula
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
65 lines (58 loc) · 2.06 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
59
60
61
62
63
64
65
language: python
sudo: required
env:
global:
- LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
- SEGFAULT_SIGNALS=all
- SALT_STATE=nessus-agent
matrix:
- OS_VERSION=6 SALT_PILLARROOT=$TRAVIS_BUILD_DIR/tests/pillar/test-linux-main
# - OS_VERSION=7 SALT_PILLARROOT=$TRAVIS_BUILD_DIR/tests/pillar/test-linux-main
services:
- docker
before_install:
- sudo apt-get update
- |
echo 'DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -s devicemapper"' | \
sudo tee /etc/default/docker > /dev/null
- sudo service docker restart
- sleep 5
- sudo docker pull centos:centos${OS_VERSION}
- sudo docker build -t local/centos:${OS_VERSION} tests/docker/centos${OS_VERSION}
install:
- |
sudo docker run --detach --privileged \
--volume="${TRAVIS_BUILD_DIR}":"${TRAVIS_BUILD_DIR}":ro \
--volume=/sys/fs/cgroup:/sys/fs/cgroup:ro \
--name centos-${OS_VERSION} local/centos:${OS_VERSION} init
- |
sudo docker exec centos-${OS_VERSION} yum -y install \
https://repo.saltstack.com/yum/redhat/salt-repo-latest-2.el${OS_VERSION}.noarch.rpm
- sudo docker exec centos-${OS_VERSION} yum -y install salt-minion util-linux-ng
- sudo docker exec centos-${OS_VERSION} salt-call --versions-report
script:
- |
sudo docker exec centos-${OS_VERSION} salt-call --local \
--retcode-passthrough --log-file-level debug \
--file-root=$TRAVIS_BUILD_DIR \
--pillar-root=$SALT_PILLARROOT \
state.show_sls \
$SALT_STATE
- |
sudo docker exec centos-${OS_VERSION} salt-call --local \
--retcode-passthrough --log-file-level debug \
--file-root=$TRAVIS_BUILD_DIR \
--pillar-root=$SALT_PILLARROOT \
state.sls \
$SALT_STATE \
mock=True
after_failure:
- sudo docker exec centos-${OS_VERSION} salt-call --local grains.items
- sudo docker exec centos-${OS_VERSION} sh -c set
- sudo docker exec centos-${OS_VERSION} more /var/log/salt/* | cat
after_script:
- sudo docker stop centos-${OS_VERSION}
notifications:
email:
on_success: never
on_failure: always