summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2022-03-20 16:44:29 +0100
committerJonas Bernoulli <jonas@bernoul.li>2022-03-20 16:44:29 +0100
commit8f112d3aef018ac2956999af544803331be3cdde (patch)
tree107ba7b7291c8ec3fe0ecfd2600df7885f504f66 /docs
parent31473211514fd29e3e86b107ec30ea04bc2563c4 (diff)
Automatically publish statistics
Diffstat (limited to 'docs')
-rw-r--r--docs/Makefile18
1 files changed, 13 insertions, 5 deletions
diff --git a/docs/Makefile b/docs/Makefile
index 15c20aa..c0b03de 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -52,11 +52,6 @@ html-dir: $(PKG).texi
@printf "Generating $@\n"
@texi2pdf --clean $< > /dev/null
-.PHONY: stats
-stats:
- @printf "Generating statistics\n"
- @gitstats $(GITSTATS_ARGS) $(TOP) $(GITSTATS_DIR)
-
PUBLISH_PATH ?= /manual/
RELEASE_PATH ?= /manual/$(VERSION)/
S3_BUCKET ?= s3://$(DOMAIN)
@@ -86,6 +81,19 @@ release: html html-dir pdf
@aws cloudfront create-invalidation --distribution-id $(CFRONT_DIST) --paths \
"$(subst $(space),$(comma),$(addprefix $(RELEASE_PATH),$(CFRONT_PATHS)))" > /dev/null
+.PHONY: stats
+stats:
+ @printf "Generating statistics\n"
+ @$(GITSTATS) $(GITSTATS_ARGS) $(TOP) $(GITSTATS_DIR)
+
+stats-upload:
+ @printf "Uploading statistics...\n"
+ @aws s3 sync $(GITSTATS_DIR) $(S3_BUCKET)/stats/$(PKG)
+ @printf "Uploaded to $(S3_BUCKET)/stats/$(PKG)\n"
+ @printf "Generating CDN invalidation\n"
+ @aws cloudfront create-invalidation \
+ --distribution-id $(CFRONT_DIST) --paths "/stats/*" > /dev/null
+
CLEAN = $(PKG).info dir $(PKG) $(PKG).html $(PKG).pdf
clean: