devilbox/.travis.yml
2018-12-10 00:43:42 +01:00

230 lines
7.1 KiB
YAML

###
### Enable Python support
###
language: python
###
### Enable sudo (required for docker service)
###
sudo: required
###
### Attach services
###
services:
- docker
###
### Specify combinations
###
env:
###
### Check Documentation
###
- S1=DOCUMENTATION
###
### Check Update script
###
- S1=UPDATE V1=php
- S1=UPDATE V1=httpd
- S1=UPDATE V1=mysql
- S1=UPDATE V1=rest
###
### Test various Docker/DockerCompose versions
###
### Docker versions: https://github.com/docker/docker-ce/releases
### Compose versions: https://github.com/docker/compose/releases
###
# Latest Docker version against various DockerCompose versions
- S1=DOCKER V1=1 S2=COMPOSE V2=1
- S1=DOCKER V1=1 S2=COMPOSE V2=2
- S1=DOCKER V1=1 S2=COMPOSE V2=3
- S1=DOCKER V1=1 S2=COMPOSE V2=4
- S1=DOCKER V1=1 S2=COMPOSE V2=5
# 2nd Latest Docker version against various DockerCompose versions
- S1=DOCKER V1=2 S2=COMPOSE V2=1
- S1=DOCKER V1=2 S2=COMPOSE V2=2
- S1=DOCKER V1=2 S2=COMPOSE V2=3
- S1=DOCKER V1=2 S2=COMPOSE V2=4
- S1=DOCKER V1=2 S2=COMPOSE V2=5
# 3rd Latest Docker version against various DockerCompose versions
- S1=DOCKER V1=3 S2=COMPOSE V2=1
- S1=DOCKER V1=3 S2=COMPOSE V2=2
- S1=DOCKER V1=3 S2=COMPOSE V2=3
- S1=DOCKER V1=3 S2=COMPOSE V2=4
- S1=DOCKER V1=3 S2=COMPOSE V2=5
# 4th Latest Docker version against various DockerCompose versions
- S1=DOCKER V1=4 S2=COMPOSE V2=1
- S1=DOCKER V1=4 S2=COMPOSE V2=2
- S1=DOCKER V1=4 S2=COMPOSE V2=3
- S1=DOCKER V1=4 S2=COMPOSE V2=4
- S1=DOCKER V1=4 S2=COMPOSE V2=5
# 5th Latest Docker version against various DockerCompose versions
- S1=DOCKER V1=5 S2=COMPOSE V2=1
- S1=DOCKER V1=5 S2=COMPOSE V2=2
- S1=DOCKER V1=5 S2=COMPOSE V2=3
- S1=DOCKER V1=5 S2=COMPOSE V2=4
- S1=DOCKER V1=5 S2=COMPOSE V2=5
###
### The matrix specifies 2 versions to compare against each other.
### As PHP (any version) needs to be able to run with everything,
### I am going to test any PHP version against any other service.
###
###
### PHP vs WWW
###
# PHP vs Apache 2.2
- S1=PHP V1=5.3 S2=HTTPD V2=apache-2.2
- S1=PHP V1=5.4 S2=HTTPD V2=apache-2.2
- S1=PHP V1=5.5 S2=HTTPD V2=apache-2.2
- S1=PHP V1=5.6 S2=HTTPD V2=apache-2.2
- S1=PHP V1=7.0 S2=HTTPD V2=apache-2.2
- S1=PHP V1=7.1 S2=HTTPD V2=apache-2.2
- S1=PHP V1=7.2 S2=HTTPD V2=apache-2.2
- S1=PHP V1=7.3 S2=HTTPD V2=apache-2.2
- S1=PHP V1=7.4 S2=HTTPD V2=apache-2.2
# PHP vs Apache 2.4
- S1=PHP V1=5.3 S2=HTTPD V2=apache-2.4
- S1=PHP V1=5.4 S2=HTTPD V2=apache-2.4
- S1=PHP V1=5.5 S2=HTTPD V2=apache-2.4
- S1=PHP V1=5.6 S2=HTTPD V2=apache-2.4
- S1=PHP V1=7.0 S2=HTTPD V2=apache-2.4
- S1=PHP V1=7.1 S2=HTTPD V2=apache-2.4
- S1=PHP V1=7.2 S2=HTTPD V2=apache-2.4
- S1=PHP V1=7.3 S2=HTTPD V2=apache-2.4
- S1=PHP V1=7.4 S2=HTTPD V2=apache-2.4
# PHP vs Nginx stable
- S1=PHP V1=5.3 S2=HTTPD V2=nginx-stable
- S1=PHP V1=5.4 S2=HTTPD V2=nginx-stable
- S1=PHP V1=5.5 S2=HTTPD V2=nginx-stable
- S1=PHP V1=5.6 S2=HTTPD V2=nginx-stable
- S1=PHP V1=7.0 S2=HTTPD V2=nginx-stable
- S1=PHP V1=7.1 S2=HTTPD V2=nginx-stable
- S1=PHP V1=7.2 S2=HTTPD V2=nginx-stable
- S1=PHP V1=7.3 S2=HTTPD V2=nginx-stable
- S1=PHP V1=7.4 S2=HTTPD V2=nginx-stable
# PHP vs Nginx mainline
- S1=PHP V1=5.3 S2=HTTPD V2=nginx-mainline
- S1=PHP V1=5.4 S2=HTTPD V2=nginx-mainline
- S1=PHP V1=5.5 S2=HTTPD V2=nginx-mainline
- S1=PHP V1=5.6 S2=HTTPD V2=nginx-mainline
- S1=PHP V1=7.0 S2=HTTPD V2=nginx-mainline
- S1=PHP V1=7.1 S2=HTTPD V2=nginx-mainline
- S1=PHP V1=7.2 S2=HTTPD V2=nginx-mainline
- S1=PHP V1=7.3 S2=HTTPD V2=nginx-mainline
- S1=PHP V1=7.4 S2=HTTPD V2=nginx-mainline
###
### Installation
###
install:
# Install dependencies for documentation
- if [ "${S1}" = "DOCUMENTATION" ]; then
max=100; i=0; while [ $i -lt $max ]; do if pip install sphinx; then break; else i=$((i+1)); fi done;
max=100; i=0; while [ $i -lt $max ]; do if pip install sphinx-autobuild; then break; else i=$((i+1)); fi done;
max=100; i=0; while [ $i -lt $max ]; do if pip install recommonmark; then break; else i=$((i+1)); fi done;
max=100; i=0; while [ $i -lt $max ]; do if pip install sphinx_rtd_theme; then break; else i=$((i+1)); fi done;
fi
# Determine latest Docker version in apt
- set -e;
DOCKER_APT="";
if [ "${S1}" = "DOCKER" ]; then
max=100; i=0; while [ $i -lt $max ]; do if sudo apt-get update -qq; then break; else i=$((i+1)); fi; done;
DOCKER_APT="$( curl -sS https://raw.githubusercontent.com/cytopia/tools/master/docker-apt-versions | sh -s "${V1}" )";
fi;
if [ -n "${DOCKER_APT}" ]; then
DOCKER_APT="=${DOCKER_APT}";
fi;
echo "${DOCKER_APT}";
# Determine latest Docker Compose version
- set -e;
if [ "${S2}" = "COMPOSE" ]; then
COMPOSE_VERSION="$( curl -sS https://raw.githubusercontent.com/cytopia/tools/master/docker-compose-versions | sh -s "${V2}" )";
else
COMPOSE_VERSION="$( curl -sS https://raw.githubusercontent.com/cytopia/tools/master/docker-compose-versions | sh -s 1 )";
fi;
echo "${COMPOSE_VERSION}";
# Install Docker and Docker Compose
- set -e;
if [ "${S1}" != "DOCUMENTATION" ]; then
max=100; i=0; while [ $i -lt $max ]; do
if sudo apt-get update -qq; then break; else i=$((i+1)); fi;
done;
max=100; i=0; while [ $i -lt $max ]; do
if sudo apt-get -y -qq -o Dpkg::Options::="--force-confnew" install docker-ce${DOCKER_APT}; then break; else i=$((i+1)); fi;
done;
max=100; i=0; while [ $i -lt $max ]; do
if curl -L --retry 100 --retry-max-time 0 https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose; then break; else i=$((i+1)); fi;
done;
chmod +x docker-compose;
sudo mv -f docker-compose /usr/local/bin;
fi
###
### Before Script
###
before_script:
# Disable services enabled by default
# http://docs.travis-ci.com/user/database-setup/#MySQL
- sudo service mysql stop || true
- sudo service postgresql stop || true
- sudo service memcached stop || true
- sudo service redis stop || true
- sudo service mongodb stop || true
- netstat -tuln
# Ensure Docker is restarted
- sudo service docker stop || true
- sudo service docker start || true
# Show Python/pip
- if [ "${S1}" = "DOCUMENTATION" ]; then
pip freeze;
pip --version;
python --version;
fi
# Show Docker/Docker Compose
- if [ "${S1}" != "DOCUMENTATION" ]; then
docker --version;
docker-compose --version;
fi
###
### Test
###
script:
- if [ "${S1}" = "DOCUMENTATION" ]; then
cd docs/;
make build;
make linkcheck;
make linkcheck2;
elif [ "${S1}" = "UPDATE" ]; then
./update-docker.sh "${V1}";
elif [ "${S1}" = "DOCKER" ]; then
cd .tests/;
make init;
make start;
make info;
make test;
else
cd .tests/;
make init;
make configure SRV="${S1}_SERVER" VER="${V1}";
make configure SRV="${S2}_SERVER" VER="${V2}";
make start;
make info;
make test;
fi