From 841b17f3935b7df01892ebdf785eceb101d0cbe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Or=C5=A1uli=C4=87?= Date: Fri, 19 May 2017 06:34:43 +0000 Subject: [PATCH] Do not ignore docker history command errors. (#345) Fixes googlecartographer/cartographer#292 --- scripts/save_docker_cache.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/save_docker_cache.sh b/scripts/save_docker_cache.sh index 03d0976..4f5dc59 100755 --- a/scripts/save_docker_cache.sh +++ b/scripts/save_docker_cache.sh @@ -23,7 +23,8 @@ set -o pipefail if [[ ${TRAVIS_BRANCH} == "master" ]] && [[ ${TRAVIS_PULL_REQUEST} == "false" ]]; then - mkdir -p $(dirname ${DOCKER_CACHE_FILE}); - docker save $(docker history -q cartographer_ros:${ROS_RELEASE} | - grep -v '') | gzip > ${DOCKER_CACHE_FILE}; + mkdir -p $(dirname ${DOCKER_CACHE_FILE}) + IMAGE_NAMES=$(docker history -q cartographer_ros:${ROS_RELEASE} | grep -v '') + docker save ${IMAGE_NAMES} | gzip > ${DOCKER_CACHE_FILE}.new + mv ${DOCKER_CACHE_FILE}.new ${DOCKER_CACHE_FILE} fi