-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.travis.yml
62 lines (56 loc) · 3.88 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
language: python
dist: bionic
env:
global:
- BS_PIP_ALLOWED=1
- BS_ECHO_DEBUG=1
- STATE=vhosting.travis,vhosting
matrix:
include:
- python: 3.7
env: PYTHONVERSION=python3.7 SALT_ARGS="-l debug --local --retcode-passthrough --pillar-root=.salt/pillar/vanilla-nginx --file-root=$PWD"
- python: 3.7
env: PYTHONVERSION=python3.7 SALT_ARGS="-l debug --local --retcode-passthrough --pillar-root=.salt/pillar/vanilla-apache --file-root=$PWD"
- python: 2.7
env: PYTHONVERSION=python2.7 SALT_ARGS="-l debug --local --retcode-passthrough --pillar-root=.salt/pillar/vanilla-nginx --file-root=$PWD"
- python: 2.7
env: PYTHONVERSION=python2.7 SALT_ARGS="-l debug --local --retcode-passthrough --pillar-root=.salt/pillar/vanilla-apache --file-root=$PWD"
before_install:
- sudo apt-get update
# Temporary workaround for vhosting-formula#1
- sudo mkdir -p /etc/salt/minion.d
- echo "mysql.default_file:" "'/etc/mysql/debian.cnf'" | sudo tee -a /etc/salt/minion.d/mysql.conf
# End of workaround
- curl -L http://bootstrap.saltstack.org | sudo -E sh -s -- -x ${PYTHONVERSION} stable
# Cleanup Travis' MySQL leftovers as they conflict with the MariaDB clean install
- sudo apt-get purge mysql-common mysql-server mysql-client
# Fix MariaDB debconf requirement
- DEBIAN_FRONTEND=noninteractive sudo apt-get install -y debconf-utils
- sudo rm /etc/mysql /var/lib/mysql /var/log/mysql -rf
# Generate SSL certificate for testing this part of the state
- sudo mkdir -p $PWD/ssl
- sudo openssl req -x509 -nodes -days 3650 -subj '/C=NL/ST=Utrecht/L=Amersfoort/O=Enrise/CN=ssl-demo-one.example' -newkey rsa:2048 -keyout $PWD/ssl/ssl-demo-one.example.key -out $PWD/ssl/ssl-demo-one.example.pem
- sudo openssl req -x509 -nodes -days 3650 -subj '/C=NL/ST=Utrecht/L=Amersfoort/O=Enrise/CN=ssl-demo-two.example' -newkey rsa:2048 -keyout $PWD/ssl/ssl-demo-two.example.key -out $PWD/ssl/ssl-demo-two.example.pem
- sudo openssl req -x509 -nodes -days 3650 -subj '/C=NL/ST=Utrecht/L=Amersfoort/O=Enrise/CN=ssl-demo-three.example' -newkey rsa:2048 -keyout $PWD/ssl/ssl-demo-three.example.key -out $PWD/ssl/ssl-demo-three.example.pem
- sudo openssl req -x509 -nodes -days 3650 -subj '/C=NL/ST=Utrecht/L=Amersfoort/O=Enrise/CN=ssl-demo-four.example' -newkey rsa:2048 -keyout $PWD/ssl/ssl-demo-four.example.key -out $PWD/ssl/ssl-demo-four.example.pem
- sudo openssl req -x509 -nodes -days 3650 -subj '/C=NL/ST=Utrecht/L=Amersfoort/O=Enrise/CN=ssl-demo-five.example' -newkey rsa:2048 -keyout $PWD/ssl/ssl-demo-five.example.key -out $PWD/ssl/ssl-demo-five.example.pem
install:
- sudo mkdir -p /srv && sudo ln -sfn $PWD /srv/formula
# Show the loaded pillars since the states are generally depending on this
- sudo salt-call pillar.items $SALT_ARGS
# See what kind of travis box you're on to help with making your states
# compatible with travis
- sudo salt-call grains.items $SALT_ARGS
# Additional tasks required since this relies on more formulas
- sudo git clone https://github.com/enrise/nginx-formula.git $PWD/nginx-formula && ln -sfn $PWD/nginx-formula/nginx $PWD/nginx
- sudo git clone https://github.com/enrise/phpfpm-formula.git $PWD/phpfpm-formula && ln -sfn $PWD/phpfpm-formula/phpfpm $PWD/phpfpm
- sudo git clone https://github.com/enrise/mariadb-formula.git $PWD/mariadb-formula && ln -sfn $PWD/mariadb-formula/mariadb $PWD/mariadb
- sudo git clone https://github.com/enrise/apache-formula.git $PWD/apache-formula && ln -sfn $PWD/apache-formula/apache $PWD/apache
- sudo git clone https://github.com/enrise/zendserver-formula.git $PWD/zendserver-formula && ln -sfn $PWD/zendserver-formula/zendserver $PWD/zendserver
script:
- sudo -E salt-call state.show_sls $STATE $SALT_ARGS
- sudo -E salt-call state.sls $STATE $SALT_ARGS
# Idempotence check
- sudo -E salt-call state.sls $STATE $SALT_ARGS > /tmp/second
- cat /tmp/second
- bash -c '! grep -q "^Not Run:" /tmp/second'