From 584e19101cb83954716eaf587c1842ad8c437723 Mon Sep 17 00:00:00 2001 From: "David A. Harding" Date: Wed, 25 Feb 2015 16:02:00 -0500 Subject: [PATCH] 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. --- Makefile | 18 +++++++++++++++++- _templates/about-us.html | 1 + _templates/development.html | 1 + _templates/events.html | 1 + en/rss/events.rss | 1 + 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index da637f6a..a31783c9 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/_templates/about-us.html b/_templates/about-us.html index 1594c2cf..39ef1659 100644 --- a/_templates/about-us.html +++ b/_templates/about-us.html @@ -5,6 +5,7 @@ layout: base id: about-us --- +

{% translate pagetitle %}

{% translate pagedesc %}

diff --git a/_templates/development.html b/_templates/development.html index c53b8fed..83282a33 100755 --- a/_templates/development.html +++ b/_templates/development.html @@ -5,6 +5,7 @@ layout: base id: development --- +

{% translate pagetitle %}

{% translate summary %}

diff --git a/_templates/events.html b/_templates/events.html index d1f8f764..d18c1c14 100644 --- a/_templates/events.html +++ b/_templates/events.html @@ -5,6 +5,7 @@ layout: base id: events --- +

{% translate pagetitle %}rss

{% translate pagedesc %}

diff --git a/en/rss/events.rss b/en/rss/events.rss index 05ce6e8e..b758cbeb 100644 --- a/en/rss/events.rss +++ b/en/rss/events.rss @@ -4,6 +4,7 @@ --- + Bitcoin conferences and events https://bitcoin.org/en/events