Proof the site with CircleCI.
This commit is contained in:
parent
6d4a1ec4e6
commit
fdc0e33ebc
4
Gemfile
4
Gemfile
|
@ -32,3 +32,7 @@ if ENV['BENCHMARK']
|
||||||
gem 'rbtrace'
|
gem 'rbtrace'
|
||||||
gem 'stackprof'
|
gem 'stackprof'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if ENV['PROOF']
|
||||||
|
gem 'html-proofer', '~> 2.0'
|
||||||
|
end
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
machine:
|
||||||
|
timezone: UTC
|
||||||
|
ruby:
|
||||||
|
version: 2.1.5
|
||||||
|
environment:
|
||||||
|
PROOF: true
|
||||||
|
test:
|
||||||
|
override:
|
||||||
|
- script/proof -f
|
34
script/proof
34
script/proof
|
@ -5,20 +5,24 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [[ "$1" != "-f" ]]; then
|
function msg {
|
||||||
git diff --name-only ..master | grep '^site/' || {
|
printf "\e[0;37m==> $1\e[0m\n"
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bundle exec jekyll build -s site -d _site --trace
|
SOURCE="site"
|
||||||
printf "\e[0;36mProofing begins now!\e[0m\n"
|
DESTINATION="_site"
|
||||||
htmlproof ./_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/
|
||||||
|
|
Loading…
Reference in New Issue