diff --git a/.travis.yml b/.travis.yml index 57523923fde618..f227a201a5eea2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,13 +34,15 @@ install: - make install script: -- set -e # Check website - | + set -e if [ "$TRAVIS_BRANCH" == "gh-pages" ] then htmlproofer --http-status-ignore 405,999 --url-ignore "/.*localhost.*/","/.*vimeo\.com.*/" --file-ignore "/.*\/files\/.*/" else + make build + # TODO: remove `|| return 0` when htmlproofer passes for the first time make check || return 0 fi diff --git a/Makefile b/Makefile index ce48f97a181cc7..59da2fd2f88825 100644 --- a/Makefile +++ b/Makefile @@ -24,11 +24,11 @@ serve: ## run a local server detached-serve: ## run a local server in detached mode ${JEKYLL} serve --detach -.PHONY: detached_serve +.PHONY: detached-serve build: ## build files but do not run a server ${JEKYLL} build -.PHONY: site +.PHONY: build check: build ## validate HTML bundle exec htmlproofer --http-status-ignore 405,999 --url-ignore "/.*localhost.*/","/.*vimeo\.com.*/" --file-ignore "/.*\/files\/.*/" ./_site diff --git a/bin/publish b/bin/publish index 00057f50d06c03..d6638e3c04421e 100755 --- a/bin/publish +++ b/bin/publish @@ -20,6 +20,12 @@ git checkout origin/master .travis.yml Makefile Gemfile cp -R /tmp/site/* . +# this file must be there, if it is not, it is likely a bug during build +if [ ! -f "index.html" ]; then + echo "index.html file is missing, aborting" + exit 1 +fi + find * -type f -exec chmod 644 "{}" ";" find * -type d -exec chmod 755 "{}" ";"