From fdc0e33ebc9e4861840e66374956c47c8f5fcd95 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 7 Feb 2015 23:02:41 -0800 Subject: [PATCH] Proof the site with CircleCI. --- Gemfile | 4 ++++ circle.yml | 9 +++++++++ script/proof | 34 +++++++++++++++++++--------------- 3 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 circle.yml diff --git a/Gemfile b/Gemfile index c7edecf7..b92f100e 100644 --- a/Gemfile +++ b/Gemfile @@ -32,3 +32,7 @@ if ENV['BENCHMARK'] gem 'rbtrace' gem 'stackprof' end + +if ENV['PROOF'] + gem 'html-proofer', '~> 2.0' +end diff --git a/circle.yml b/circle.yml new file mode 100644 index 00000000..ff2a40b4 --- /dev/null +++ b/circle.yml @@ -0,0 +1,9 @@ +machine: + timezone: UTC + ruby: + version: 2.1.5 + environment: + PROOF: true +test: + override: + - script/proof -f diff --git a/script/proof b/script/proof index e5bc24b2..11af6e55 100755 --- a/script/proof +++ b/script/proof @@ -5,20 +5,24 @@ set -e -if [[ "$1" != "-f" ]]; then - git diff --name-only ..master | grep '^site/' || { - echo "No site files changed. We'll skip proofing. Run with -f to force." - exit 0 - } -fi - -echo "Some site files have been changed! Proofing..." - -command -v htmlproof || { - echo "Installing HTML::Proofer!" - gem install html-proofer -- --use-system-libraries +function msg { + printf "\e[0;37m==> $1\e[0m\n" } -bundle exec jekyll build -s site -d _site --trace -printf "\e[0;36mProofing begins now!\e[0m\n" -htmlproof ./_site +SOURCE="site" +DESTINATION="_site" + +export PROOF=true +export NOKOGIRI_USE_SYSTEM_LIBRARIES=true + +# 1. +msg "Installing..." +bundle install -j8 > /dev/null || bundle install > /dev/null + +# 2. +msg "Building..." +bundle exec jekyll build -s $SOURCE -d $DESTINATION --full-rebuild --trace + +# 3. +msg "Proofing..." +bundle exec htmlproof ./$DESTINATION --href-ignore /Chrononaut/,/twitter.com/