From 53cf4d78e63546526cff013cbc96b4e9d3f14df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 4 Jun 2020 13:18:22 +0200 Subject: [PATCH] [Travis] Check if downloaded file is an application (#547) --- bin/.travis/trusty/update_docker.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/.travis/trusty/update_docker.sh b/bin/.travis/trusty/update_docker.sh index 4e4001e59f..306bb03374 100755 --- a/bin/.travis/trusty/update_docker.sh +++ b/bin/.travis/trusty/update_docker.sh @@ -24,9 +24,15 @@ if (( $(echo "$dc < 1.23" |bc -l) )); then DOCKER_COMPOSE_VERSION="1.23.2" echo "Updating Docker Compose from ${dc} (${dc_full}) to ${DOCKER_COMPOSE_VERSION}" sudo rm -f /usr/local/bin/docker-compose - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose - chmod +x docker-compose - sudo mv docker-compose /usr/local/bin + curl --retry 5 -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose + FILE_TYPE=$(file -b --mime-type docker-compose | sed 's|/.*||') + if [[ $FILE_TYPE == "application" ]]; then + chmod +x docker-compose + sudo mv docker-compose /usr/local/bin + else + echo "Error when downloading docker-compose" + cat docker-compose + fi else echo "Skip updating Docker Compose ${dc} (${dc_full})" fi