From b007313df5d3106ac252a0dade9383293229a3d1 Mon Sep 17 00:00:00 2001 From: cytopia Date: Thu, 12 Apr 2018 08:45:51 +0200 Subject: [PATCH] Fix docker login --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 21fc27f..b31af03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -81,19 +81,17 @@ jobs: script: # Push to docker hub on success - if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then + echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin && if [ -n "${TRAVIS_TAG}" ]; then - docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD" && echo "Pushing ${IMAGE}:${TRAVIS_TAG}" && docker push "${IMAGE}:${TRAVIS_TAG}" && docker tag "${IMAGE}:${TRAVIS_TAG}" "${IMAGE}:latest" && echo "Pushing ${IMAGE}:latest" && docker push "${IMAGE}:latest"; elif [ "${TRAVIS_BRANCH}" == "master" ]; then - docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD" && echo "Pushing ${IMAGE}:latest" && docker push "${IMAGE}:latest"; elif [[ ${TRAVIS_BRANCH} =~ ^(release[/-][.0-9]+)$ ]]; then - docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD" && echo "Pushing ${IMAGE}:${TRAVIS_BRANCH}" && docker push "${IMAGE}:${TRAVIS_BRANCH}"; else