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 'stackprof'
|
||||
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
|
||||
|
||||
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/
|
||||
|
|
Loading…
Reference in New Issue