diff --git a/.semaphoreci/setup.sh b/.semaphoreci/setup.sh index 52f253d1d..e8c6e1e2e 100755 --- a/.semaphoreci/setup.sh +++ b/.semaphoreci/setup.sh @@ -1,7 +1,11 @@ #!/usr/bin/env bash set -e +sudo -E apt-get -yq update +sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install docker-engine=${DOCKER_VERSION}* +docker version + pip install --user -r requirements.txt make pull-images -make validate +ci_retry make validate diff --git a/.semaphoreci/tests.sh b/.semaphoreci/tests.sh index 15bb0fa6b..2a586ccf6 100755 --- a/.semaphoreci/tests.sh +++ b/.semaphoreci/tests.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e -make test-unit && make test-integration +make test-unit +ci_retry make test-integration make -j${N_MAKE_JOBS} crossbinary-default-parallel diff --git a/.semaphoreci/vars b/.semaphoreci/vars index 15a5e501d..5d2eb94ed 100644 --- a/.semaphoreci/vars +++ b/.semaphoreci/vars @@ -5,6 +5,8 @@ export secure='btt4r13t09gQlHb6gYrvGC2yGCMMHfnp1Mz1RQedc4Mpf/FfT8aE6xmK2a2i9CCvs export REPO='containous/traefik' +export DOCKER_VERSION=1.12.6 + if VERSION=$(git describe --exact-match --abbrev=0 --tags); then export VERSION @@ -15,3 +17,25 @@ fi export CODENAME=raclette export N_MAKE_JOBS=2 + + +function ci_retry { + + local NRETRY=3 + local NSLEEP=5 + local n=0 + + until [ $n -ge $NRETRY ] + do + "$@" && break + n=$[$n+1] + echo "$@ failed, attempt ${n}/${NRETRY}" + sleep $NSLEEP + done + + [ $n -lt $NRETRY ] + +} + +export -f ci_retry + diff --git a/.travis.yml b/.travis.yml index fdcdab568..919533465 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,32 +11,20 @@ env: - VERSION: $TRAVIS_TAG - CODENAME: raclette - N_MAKE_JOBS: 2 + - DOCKER_VERSION: 1.12.6 -matrix: - fast_finish: true - include: - - env: DOCKER_VERSION=1.10.3 - - env: DOCKER_VERSION=1.12.6 - -before_install: - - sudo -E apt-get -yq update - - sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install docker-engine=${DOCKER_VERSION}* -install: - - docker version - - pip install --user -r requirements.txt - - make pull-images -before_script: - - make validate script: - - make test-unit && travis_retry make test-integration - - make -j${N_MAKE_JOBS} crossbinary-default-parallel -after_failure: - - docker ps +- echo "Skipping tests... (Tests are executed on SemaphoreCI)" + before_deploy: - > if ! [ "$BEFORE_DEPLOY_RUN" ]; then export BEFORE_DEPLOY_RUN=1; - make -j${N_MAKE_JOBS} crossbinary-others-parallel; + sudo -E apt-get -yq update; + sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install docker-engine=${DOCKER_VERSION}*; + docker version; + pip install --user -r requirements.txt; + make -j${N_MAKE_JOBS} crossbinary-parallel; make image; mkdocs build --clean; tar cfz dist/traefik-${VERSION}.src.tar.gz --exclude-vcs --exclude dist .; diff --git a/integration/resources/compose/boulder.yml b/integration/resources/compose/boulder.yml index 8320c6a92..f1f954377 100644 --- a/integration/resources/compose/boulder.yml +++ b/integration/resources/compose/boulder.yml @@ -39,6 +39,6 @@ bmysql: MYSQL_ALLOW_EMPTY_PASSWORD: "yes" log_driver: none brabbitmq: - image: rabbitmq:3 + image: rabbitmq:3-alpine environment: RABBITMQ_NODE_IP_ADDRESS: "0.0.0.0" diff --git a/integration/resources/compose/constraints.yml b/integration/resources/compose/constraints.yml index 9a2688904..1d5395281 100644 --- a/integration/resources/compose/constraints.yml +++ b/integration/resources/compose/constraints.yml @@ -12,6 +12,6 @@ consul: - "8302" - "8302/udp" nginx: - image: nginx + image: nginx:alpine ports: - "8881:80" diff --git a/integration/resources/compose/consul_catalog.yml b/integration/resources/compose/consul_catalog.yml index 9a2688904..1d5395281 100644 --- a/integration/resources/compose/consul_catalog.yml +++ b/integration/resources/compose/consul_catalog.yml @@ -12,6 +12,6 @@ consul: - "8302" - "8302/udp" nginx: - image: nginx + image: nginx:alpine ports: - "8881:80" diff --git a/integration/resources/compose/file.yml b/integration/resources/compose/file.yml index acd082616..1d3dddd1d 100644 --- a/integration/resources/compose/file.yml +++ b/integration/resources/compose/file.yml @@ -1,20 +1,20 @@ nginx1: - image: nginx + image: nginx:alpine ports: - "8881:80" nginx2: - image: nginx + image: nginx:alpine ports: - "8882:80" nginx3: - image: nginx + image: nginx:alpine ports: - "8883:80" nginx4: - image: nginx + image: nginx:alpine ports: - "8884:80" nginx5: - image: nginx + image: nginx:alpine ports: - "8885:80" diff --git a/webui/Dockerfile b/webui/Dockerfile index 5102a3969..c78d2bfd1 100644 --- a/webui/Dockerfile +++ b/webui/Dockerfile @@ -7,7 +7,8 @@ RUN apt-get -yq update \ && apt-get -yq --no-install-suggests --no-install-recommends --force-yes install apt-transport-https \ && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ -&& apt-get -yq update && apt-get -yq --no-install-suggests --no-install-recommends --force-yes install yarn +&& apt-get -yq update && apt-get -yq --no-install-suggests --no-install-recommends --force-yes install yarn \ +&& rm -fr /var/lib/apt/lists/ COPY package.json $WEBUI_DIR/ COPY yarn.lock $WEBUI_DIR/