Simplify travis configuration

This commit is contained in:
cytopia 2018-12-15 17:50:57 +01:00
parent eff72f41a9
commit a237ce85d0
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2

View File

@ -124,19 +124,22 @@ env:
### Installation ### Installation
### ###
install: install:
# Update Debian/Ubuntu package index
- if [ "${S1}" != "DOCUMENTATION" ]; then
until sudo apt-get update -qq; do sleep 1; done
fi
# Install dependencies for documentation # Install dependencies for documentation
- if [ "${S1}" = "DOCUMENTATION" ]; then - 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; until pip install sphinx; do sleep 1; done;
max=100; i=0; while [ $i -lt $max ]; do if pip install sphinx-autobuild; then break; else i=$((i+1)); fi done; until pip install sphinx-autobuild; do sleep 1; done;
max=100; i=0; while [ $i -lt $max ]; do if pip install recommonmark; then break; else i=$((i+1)); fi done; until pip install recommonmark; do sleep 1; done;
max=100; i=0; while [ $i -lt $max ]; do if pip install sphinx_rtd_theme; then break; else i=$((i+1)); fi done; until pip install sphinx_rtd_theme; do sleep 1; done;
fi fi
# Determine latest Docker version in apt # Determine latest Docker version in apt
- set -e; - DOCKER_APT="";
DOCKER_APT="";
if [ "${S1}" = "DOCKER" ]; then 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}" )"; DOCKER_APT="$( curl -sS https://raw.githubusercontent.com/cytopia/tools/master/docker-apt-versions | sh -s "${V1}" )";
fi; fi;
if [ -n "${DOCKER_APT}" ]; then if [ -n "${DOCKER_APT}" ]; then
@ -145,8 +148,7 @@ install:
echo "${DOCKER_APT}"; echo "${DOCKER_APT}";
# Determine latest Docker Compose version # Determine latest Docker Compose version
- set -e; - if [ "${S2}" = "COMPOSE" ]; then
if [ "${S2}" = "COMPOSE" ]; then
COMPOSE_VERSION="$( curl -sS https://raw.githubusercontent.com/cytopia/tools/master/docker-compose-versions | sh -s "${V2}" )"; COMPOSE_VERSION="$( curl -sS https://raw.githubusercontent.com/cytopia/tools/master/docker-compose-versions | sh -s "${V2}" )";
else else
COMPOSE_VERSION="$( curl -sS https://raw.githubusercontent.com/cytopia/tools/master/docker-compose-versions | sh -s 1 )"; COMPOSE_VERSION="$( curl -sS https://raw.githubusercontent.com/cytopia/tools/master/docker-compose-versions | sh -s 1 )";
@ -154,17 +156,9 @@ install:
echo "${COMPOSE_VERSION}"; echo "${COMPOSE_VERSION}";
# Install Docker and Docker Compose # Install Docker and Docker Compose
- set -e; - if [ "${S1}" != "DOCUMENTATION" ]; then
if [ "${S1}" != "DOCUMENTATION" ]; then until sudo apt-get -y -qq -o Dpkg::Options::="--force-confnew" install docker-ce${DOCKER_APT}; do sleep 1; done;
max=100; i=0; while [ $i -lt $max ]; do until curl -L -sS --retry 100 --retry-max-time 0 https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose; do sleep 1; done;
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; chmod +x docker-compose;
sudo mv -f docker-compose /usr/local/bin; sudo mv -f docker-compose /usr/local/bin;
fi fi