[reproducible-website] 02/02: Add bin/publish script.

Chris Lamb chris at chris-lamb.co.uk
Tue Apr 24 08:18:55 CEST 2018


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository reproducible-website.

commit 60e58386ec5e94d653fa19c16c3e86b61e845e5b
Author: Chris Lamb <lamby at debian.org>
Date:   Tue Apr 24 08:17:06 2018 +0200

    Add bin/publish script.
---
 bin/publish | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/bin/publish b/bin/publish
new file mode 100755
index 0000000..8ad51a8
--- /dev/null
+++ b/bin/publish
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+set -eu
+
+WEEK="${1}"
+
+URL="https://reproducible-builds.org/blog/posts/${WEEK}/"
+DATE="$(date --utc +'%Y-%m-%d %M:%M:%S')"
+
+if ! shift 1
+then
+	echo "${0}: usage: ${0} <week>" >&2
+	exit 2
+fi
+
+FILENAME="_blog/posts/${WEEK}.md"
+
+if grep -qs FIXME "${FILENAME}"
+then
+	echo "${0}: ${FILENAME} contains FIXME statements; refusing to publish." >&2
+	exit 2
+fi
+
+if ! grep -qs 'published: ' "${FILENAME}"
+then
+	sed -i -e "s@^\(week: ${WEEK}\)@\1\npublished: ${DATE}@g" "${FILENAME}"
+fi
+
+git add "${FILENAME}"
+git commit -m "published as ${URL}"
+git log -1
+git tag -s "${WEEK}" -m "Publish week ${WEEK}"
+
+echo
+echo "Now verify the results and run git push && git push --tags."
+echo
+echo "After publishing, Tweet this via:"
+echo
+echo "  %tweet What happened in the @ReproBuilds effort between $(tr '\n' ' ' < "${FILENAME}" | sed -n -e 's at .* effort between \([^:]*\):.*@\1 at p'): https://reproducible-builds.org/blog/posts/${WEEK}/"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/reproducible-website.git


More information about the rb-commits mailing list