branch: elpa/emacsql
commit 5156a4a23a402e0fadf4951bde9c4a2cf158706a
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    make: Add stats target
---
 .gitignore |  1 +
 Makefile   | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/.gitignore b/.gitignore
index bc68773466..21d881f251 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,4 +2,5 @@
 /*-autoloads.el
 /.config.mk
 
+/stats/
 /sqlite/emacsql-sqlite
diff --git a/Makefile b/Makefile
index e1daee410b..19c582c066 100644
--- a/Makefile
+++ b/Makefile
@@ -88,3 +88,20 @@ $(PKG)-autoloads.el: $(ELS)
 test: all $(TEST_ELCS)
        @$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) \
        -L tests -l tests/emacsql-tests.elc -f ert-run-tests-batch-and-exit
+
+GITSTATS      ?= gitstats
+GITSTATS_DIR  ?= $(TOP)stats
+GITSTATS_ARGS ?= -c style=https://magit.vc/assets/stats.css -c max_authors=999
+
+.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

Reply via email to