From e6f529dd4eb2cffdada4855ee55037e4a414c96c Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Mon, 20 Jun 2022 20:29:36 +0200 Subject: Store the git hash of developer docs loaded This will require some further updates on the loading side of things before it's fully valid, but for now track and show a link to the git hash used to build developer docs *if* one is specified. We only track it for devel (because releases have release numbers) and we only show it in the cases where we would already show the loading time. --- tools/docs/docload.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tools/docs/docload.py') diff --git a/tools/docs/docload.py b/tools/docs/docload.py index 1807e214..4eff9858 100755 --- a/tools/docs/docload.py +++ b/tools/docs/docload.py @@ -104,6 +104,8 @@ parser.add_option("-q", "--quiet", action="store_true", dest="quiet", help="Run quietly (no output at all)") parser.add_option("-v", "--verbose", action="store_true", dest="verbose", help="Run verbosely") +parser.add_option("-g", "--git", type=str, + help="Specify git hash used to load") (options, args) = parser.parse_args() if len(args) != 2: @@ -233,7 +235,15 @@ if not quiet: if numchanges > 0: # Update the docs loaded timestamp - curs.execute("UPDATE core_version SET docsloaded=CURRENT_TIMESTAMP WHERE tree=%(v)s", {'v': ver}) + if ver == "0" and options.git: + githash = options.git + else: + githash = '' + + curs.execute("UPDATE core_version SET docsloaded=CURRENT_TIMESTAMP, docsgit=%(git)s WHERE tree=%(v)s", { + 'v': ver, + 'git': githash, + }) # Issue varnish purge for all docs of this version if ver == "0": -- cgit v1.2.3