From e1444978bb569a396ba4a04f2c621e96a1893e5b Mon Sep 17 00:00:00 2001 From: sfalexrog Date: Mon, 3 Jun 2019 21:16:04 +0300 Subject: [PATCH] builder: fast docs rebuild (for pull requests) (#126) * builder: Skip builds for docs-only pull requests * force rebuild * travis: Fix bad syntax * travis: Be more strict about checking for changes * travis: Make build skipping more noticeable --- .travis.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index aa38356c..695bc3ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,16 @@ jobs: # Check if there are any cached images, copy them to our "images" directory - if [ -n "$(ls -A imgcache/*.zip)" ]; then mkdir -p images && cp imgcache/*.zip images; fi script: - - docker run --privileged --rm -v /dev:/dev -v $(pwd):/builder/repo -e TRAVIS_TAG="${TRAVIS_TAG}" ${DOCKER} + - if [[ -z ${TRAVIS_TAG} && ${TRAVIS_PULL_REQUEST} ]]; then + echo "Commit range is ${TRAVIS_COMMIT_RANGE}" && + if [ $(git diff --name-only ${TRAVIS_COMMIT_RANGE} | grep -v ^"docs/" | wc -l) -eq 0 ]; then + echo " === Docs-only change; skipping build ===" && + export SKIP_BUILD=true; + fi; + fi + - if [ -z ${SKIP_BUILD} ]; then + docker run --privileged --rm -v /dev:/dev -v $(pwd):/builder/repo -e TRAVIS_TAG="${TRAVIS_TAG}" ${DOCKER}; + fi before_cache: - cp images/*.zip imgcache before_deploy: