Skip to content

Commit

Permalink
Merge pull request #488 from galaxyproject/travis-must-fail
Browse files Browse the repository at this point in the history
Make sure the Travis build fails when website cannot be built
  • Loading branch information
nsoranzo authored Aug 31, 2017
2 parents 2d1e5c0 + f6c972b commit 5ea6b8c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions bin/publish
Original file line number Diff line number Diff line change
Expand Up @@ -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 "{}" ";"

Expand Down

0 comments on commit 5ea6b8c

Please sign in to comment.