Skip to content

Commit

Permalink
if links are broken fail build (hyperledger-archives#1933)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbwhite authored and Simon Stone committed Aug 21, 2017
1 parent 9657441 commit 9531205
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ jspm_packages
#generated jsdoc
packages/composer-website/jekylldocs/jsdoc/

#Broken link report
packages/composer-website/linkresults.txt


packages/composer-playground/src/assets/npmlist.json

packages/composer-systests/systestv1/tls/ca/fabric-ca-server.db
Expand Down
16 changes: 11 additions & 5 deletions packages/composer-website/scripts/linkcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,25 @@ sleep 10
cat ${DIR}/jekyll.log
URL="$( cat ${DIR}/jekyll.log | awk '/Server address:/ { print $3 }')"

# set the return code for this script
RC=0

echo Starting linkchecking... ${URL}
linkchecker --ignore-url=jsdoc ${URL} -F text/UTF8/${DIR}/linkresults.txt

if [ "$?" != "0" ]; then
asciify '!!Broken Links!!' -f standard
asciify '!!Broken Links!!' -f standard
cat ${DIR}/linkresults.txt
# return 1 to indicate the the build has failed
RC=1

# set the links as being broken.
# need to ignore the jsdoc somehow for the momeny
fi

# always show the file - includes number of links checked
cat ${DIR}/linkresults.txt

# clean up the running Jekyll server
kill %${JOBN}
sleep 1
jobs
jobs
echo Ending script with rc=${RC}
exit ${RC}

0 comments on commit 9531205

Please sign in to comment.