Skip to content

Instantly share code, notes, and snippets.

@thedavecarroll
Created August 27, 2018 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thedavecarroll/74438e76f6d0de1a77d09bcd956d4203 to your computer and use it in GitHub Desktop.
Save thedavecarroll/74438e76f6d0de1a77d09bcd956d4203 to your computer and use it in GitHub Desktop.
CI Build Script
#!/usr/bin/env bash
set -e # halt script on error
echo
echo "------------------------------------------------------------------------------------------------------------------------"
if [ "$TRAVIS_PULL_REQUEST" != "false" -a "$TRAVIS_BRANCH" == "comments" ]; then
echo
echo "Building site for pull request for $TRAVIS_BRANCH..."
bundle exec jekyll build --config _config.yml --source . --destination ./docs
echo "Site built into /docs"
echo
echo "Proofing links"
bundle exec htmlproofer ./docs --disable-external --allow_hash_href
echo "Proofing links complete"
echo
echo "------------------------------------------------------------------------------------------------------------------------"
exit 0
elif [ "$TRAVIS_BRANCH" == "master" ]; then
echo
echo "Building site for $TRAVIS_BRANCH..."
bundle exec jekyll build --config _config.yml --source . --destination ./docs
echo "Site built into /docs"
echo
echo "Proofing links"
bundle exec htmlproofer ./docs --disable-external --allow_hash_href
echo "Proofing links complete"
echo
echo "------------------------------------------------------------------------------------------------------------------------"
exit 0
else
echo
echo "Build not triggered internally"
echo
echo "------------------------------------------------------------------------------------------------------------------------"
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment