From a352f54870e8d8f5e81a95c9116d300ca0df065c Mon Sep 17 00:00:00 2001 From: Michael Stucki Date: Fri, 3 Apr 2015 19:58:10 +0200 Subject: [PATCH] Fix check if build is needed --- CHANGELOG.md | 2 ++ run.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0990295..f7d4841 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased][unreleased] +### Fixed +- Fix check if build is needed ## [0.3.0] - 2015-03-31 ### Added diff --git a/run.sh b/run.sh index fb9ab5b..84450ca 100755 --- a/run.sh +++ b/run.sh @@ -15,11 +15,11 @@ mkdir -p $SOURCE mkdir -p $CCACHE # Build image if needed -IMAGE_EXISTS=$(docker images $REPOSITORY | grep "$TAG") +IMAGE_EXISTS=$(docker images $REPOSITORY) if [ $? -ne 0 ]; then echo "docker command not found" exit $? -elif [[ -z $IMAGE_EXISTS ]] || [[ $FORCE_BUILD = 1 ]]; then +elif [[ $FORCE_BUILD = 1 ]] || ! echo "$IMAGE_EXISTS" | grep -q "$TAG"; then echo "Building Docker image $REPOSITORY:$TAG..." docker build -t $REPOSITORY:$TAG . fi