QA: Simplify Comparison Between Local And Remote Site Files

This commit adds an extra step to the build process to SHA256 checksum
all the files that are built purely based on repository contents.  The
checksums file is uploaded to the webserver with the rest of the site
content.

A separate target is added to the Makefile to compare the remote
sha256sums file to a locally-built file to see if they differ.  This
allows us to detect when a remote build may have gone astray.
This commit is contained in:
David A. Harding 2015-02-25 16:02:00 -05:00
parent 45855ab2d9
commit 584e19101c
No known key found for this signature in database
GPG key ID: 4B29C30FF29EC4B7
5 changed files with 21 additions and 1 deletions

View file

@ -58,6 +58,9 @@ post-build-tests: post-build-tests-fast
## overwritten content is under version control
manual-updates: manual-update-summaries-file
## All manual checks that can be run by a human
manual-checks: manual-check-diff-sha256sums
@ -71,7 +74,9 @@ ERROR_ON_OUTPUT="sed '1s/^/ERROR:\n/' | if grep . ; then sed 1iERROR ; false ; e
## This should not affect webpage output.
build:
$S export LANG=C.UTF-8 ; eval $(JEKYLL_COMMAND) 2>&1 | tee $(JEKYLL_LOG)
$S grep -r -L 'Note: this file is built non-deterministically' _site/ \
| egrep -v 'sha256sums.txt' \
| xargs sha256sum > _site/sha256sums.txt
## Jekyll annoyingly returns success even when it emits errors and
## exceptions, so we'll grep its output for error strings
@ -181,3 +186,14 @@ manual-update-summaries-file:
$S echo "{%comment%}AUTOMATICALLY-GENERATED FILE: DO NOT EDIT THIS FILE" > _includes/helpers/summaries.md
$S echo "This file is licensed under the terms of its source texts{%endcomment%}" >> _includes/helpers/summaries.md
$S grep -rh --exclude='*summaries.md' 'assign summary_' _includes/ | sort >> _includes/helpers/summaries.md
manual-check-diff-sha256sums:
## A manually-run command to check the locally-built
## _site/sha256sums.txt file against the same file on the webserver to
## see if any files were built differently upstream from what we have
## locally
$S echo "Files listed below (if any) have different hashes"
$S curl -s -o- https://bitcoin.org/sha256sums.txt \
| sort - _site/sha256sums.txt \
| uniq -u \
| sort -k2