diff --git a/.travis.yml b/.travis.yml index 39ad8bf3..352ea59d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ services: echo "This is a new branch" elif ! git diff --name-only "$TRAVIS_COMMIT_RANGE" -- &> /dev/null; then echo "Change range not recognized: '$TRAVIS_COMMIT_RANGE'" - elif git diff --name-only "$TRAVIS_COMMIT_RANGE" -- | grep -Eq "^$Dockerfile"; then + elif git diff --name-only "$TRAVIS_COMMIT_RANGE" -- | grep -Eq "^$Dockerfile$"; then echo "Change of $Dockerfile detected." else echo "Skip build of $Dockerfile as it's not changed." diff --git a/travis.yml.template b/travis.yml.template index 475c10ad..657c39ce 100644 --- a/travis.yml.template +++ b/travis.yml.template @@ -22,7 +22,7 @@ services: echo "This is a new branch" elif ! git diff --name-only "$TRAVIS_COMMIT_RANGE" -- &> /dev/null; then echo "Change range not recognized: '$TRAVIS_COMMIT_RANGE'" - elif git diff --name-only "$TRAVIS_COMMIT_RANGE" -- | grep -Eq "^$Dockerfile"; then + elif git diff --name-only "$TRAVIS_COMMIT_RANGE" -- | grep -Eq "^$Dockerfile$"; then echo "Change of $Dockerfile detected." else echo "Skip build of $Dockerfile as it's not changed."