-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
36 lines (31 loc) · 1.39 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
sudo: required
dist: trusty
language: python
python:
- '2.7'
before_install:
- git submodule update --init --recursive
- sudo apt-get update
- git clone https://github.com/saltstack/salt-bootstrap.git && sudo sh salt-bootstrap/bootstrap-salt.sh
install:
# Copy these states
- sudo mkdir -p /srv/provision
- sudo cp -r salt pillar formulas /srv/provision
- sudo cp .travis/travis_secret.sls /srv/provision/pillar/docker/secret.sls
- sudo mkdir -p /srv/docker/nginx/nginx-startup && sudo cp .travis/start.sh /srv/docker/nginx/nginx-startup
- sudo cp salt/minion /etc/salt/minion
- sudo pip install -U urllib3==1.14
- sudo service salt-minion restart
# This ones may fail. So we make sure it returns true.
- sudo salt-call state.highstate --local --retcode-passthrough || true
- sudo salt-call state.highstate --local --retcode-passthrough || true
# Additional debug help
- sudo cat /var/log/salt/*
# See what kind of travis box you're on
# to help with making your states compatible with travis
- sudo salt-call grains.items --local
script:
- sudo salt-call state.highstate --local --retcode-passthrough
# We check if any of the dockers is either halted or restarting, and for each of those we print 'docker logs'.
- for container in `docker ps -a | grep 'Exit\|Restarting' | awk '{print $NF}'`; do docker logs $container && echo $container; false; done
- docker ps -a