diff --git a/.travis.yml b/.travis.yml index 04e7a629..4f7d0d3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -99,30 +99,30 @@ script: echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin && if [ "${TRAVIS_BRANCH}" == "master" ]; then echo "Pushing latest"; - docker push "${IMAGE}:${PHP}-base"; - docker push "${IMAGE}:${PHP}-mods"; - docker push "${IMAGE}:${PHP}-prod"; - docker push "${IMAGE}:${PHP}-work"; + until docker push "${IMAGE}:${PHP}-base"; do sleep 1; done; + until docker push "${IMAGE}:${PHP}-mods"; do sleep 1; done; + until docker push "${IMAGE}:${PHP}-prod"; do sleep 1; done; + until docker push "${IMAGE}:${PHP}-work"; do sleep 1; done; elif [[ ${TRAVIS_BRANCH} =~ ^(release-[.0-9]+)$ ]]; then echo "Pushing branch ${TRAVIS_BRANCH}"; docker tag "${IMAGE}:${PHP}-base" "${IMAGE}:${PHP}-base-${TRAVIS_BRANCH}" && docker tag "${IMAGE}:${PHP}-mods" "${IMAGE}:${PHP}-mods-${TRAVIS_BRANCH}" && docker tag "${IMAGE}:${PHP}-prod" "${IMAGE}:${PHP}-prod-${TRAVIS_BRANCH}" && docker tag "${IMAGE}:${PHP}-work" "${IMAGE}:${PHP}-work-${TRAVIS_BRANCH}" && - docker push "${IMAGE}:${PHP}-base-${TRAVIS_BRANCH}"; - docker push "${IMAGE}:${PHP}-mods-${TRAVIS_BRANCH}"; - docker push "${IMAGE}:${PHP}-prod-${TRAVIS_BRANCH}"; - docker push "${IMAGE}:${PHP}-work-${TRAVIS_BRANCH}"; + until docker push "${IMAGE}:${PHP}-base-${TRAVIS_BRANCH}"; do sleep 1; done; + until docker push "${IMAGE}:${PHP}-mods-${TRAVIS_BRANCH}"; do sleep 1; done; + until docker push "${IMAGE}:${PHP}-prod-${TRAVIS_BRANCH}"; do sleep 1; done; + until docker push "${IMAGE}:${PHP}-work-${TRAVIS_BRANCH}"; do sleep 1; done; elif [ -n "${TRAVIS_TAG}" ]; then echo "Pushing tag ${TRAVIS_TAG}"; docker tag "${IMAGE}:${PHP}-base" "${IMAGE}:${PHP}-base-${TRAVIS_TAG}" && docker tag "${IMAGE}:${PHP}-mods" "${IMAGE}:${PHP}-mods-${TRAVIS_TAG}" && docker tag "${IMAGE}:${PHP}-prod" "${IMAGE}:${PHP}-prod-${TRAVIS_TAG}" && docker tag "${IMAGE}:${PHP}-work" "${IMAGE}:${PHP}-work-${TRAVIS_TAG}" && - docker push "${IMAGE}:${PHP}-base-${TRAVIS_TAG}"; - docker push "${IMAGE}:${PHP}-mods-${TRAVIS_TAG}"; - docker push "${IMAGE}:${PHP}-prod-${TRAVIS_TAG}"; - docker push "${IMAGE}:${PHP}-work-${TRAVIS_TAG}"; + until docker push "${IMAGE}:${PHP}-base-${TRAVIS_TAG}"; do sleep 1; done; + until docker push "${IMAGE}:${PHP}-mods-${TRAVIS_TAG}"; do sleep 1; done; + until docker push "${IMAGE}:${PHP}-prod-${TRAVIS_TAG}"; do sleep 1; done; + until docker push "${IMAGE}:${PHP}-work-${TRAVIS_TAG}"; do sleep 1; done; elif [ "${TRAVIS_EVENT_TYPE}" = "cron" ]; then if MY_TAG="$( git describe --exact-match "$(git rev-parse HEAD)" 2>/dev/null )"; then echo "Pushing cron tag ${MY_TAG}"; @@ -130,10 +130,10 @@ script: docker tag "${IMAGE}:${PHP}-mods" "${IMAGE}:${PHP}-mods-${MY_TAG}" && docker tag "${IMAGE}:${PHP}-prod" "${IMAGE}:${PHP}-prod-${MY_TAG}" && docker tag "${IMAGE}:${PHP}-work" "${IMAGE}:${PHP}-work-${MY_TAG}" && - docker push "${IMAGE}:${PHP}-base-${MY_TAG}"; - docker push "${IMAGE}:${PHP}-mods-${MY_TAG}"; - docker push "${IMAGE}:${PHP}-prod-${MY_TAG}"; - docker push "${IMAGE}:${PHP}-work-${MY_TAG}"; + until docker push "${IMAGE}:${PHP}-base-${MY_TAG}"; do sleep 1; done; + until docker push "${IMAGE}:${PHP}-mods-${MY_TAG}"; do sleep 1; done; + until docker push "${IMAGE}:${PHP}-prod-${MY_TAG}"; do sleep 1; done; + until docker push "${IMAGE}:${PHP}-work-${MY_TAG}"; do sleep 1; done; fi else echo "Skipping push to dockerhub on normal branches";