-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.travis.yml
59 lines (50 loc) · 1.97 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
dist: jammy
language: shell
env:
global:
- SALT_STATE=scap.scan
matrix:
- OS_VERSION=8 SALT_PILLARROOT=$TRAVIS_BUILD_DIR/tests/pillar/test-scc
- OS_VERSION=8 SALT_PILLARROOT=$TRAVIS_BUILD_DIR/tests/pillar/test-oscap
- OS_VERSION=9 SALT_PILLARROOT=$TRAVIS_BUILD_DIR/tests/pillar/test-scc
- OS_VERSION=9 SALT_PILLARROOT=$TRAVIS_BUILD_DIR/tests/pillar/test-oscap
stages:
- canary
- test
if: branch = master OR type = pull_request OR tag is present
before_install:
- sudo apt-get update
- sudo docker build -t local/alma:${OS_VERSION} tests/docker/alma${OS_VERSION}
install:
- sudo docker run --detach --privileged
--volume="${TRAVIS_BUILD_DIR}":"${TRAVIS_BUILD_DIR}":ro
--name alma-${OS_VERSION} local/alma:${OS_VERSION} init
- sudo docker exec alma-${OS_VERSION} rpm --import https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public
- sudo docker exec alma-${OS_VERSION} curl -sSL -o /etc/yum.repos.d/salt.repo https://github.com/saltstack/salt-install-guide/releases/download/v1.3.2/salt.repo
- sudo docker exec alma-${OS_VERSION} yum -y install salt-minion util-linux-ng
- sudo docker exec alma-${OS_VERSION} salt-call --versions-report
script: |
set -e
sudo docker exec alma-${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 alma-${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 alma-${OS_VERSION} salt-call --local grains.items
- sudo docker exec alma-${OS_VERSION} sh -c set
- sudo docker exec alma-${OS_VERSION} more /var/log/salt/* | cat
after_script:
- sudo docker stop alma-${OS_VERSION}
notifications:
email:
on_success: never
on_failure: always