summaryrefslogtreecommitdiffstats
path: root/extra/git-post-commit.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 16:24:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 16:24:27 +0000
commit6c18848a903eb3ee06dccd915859ce64195c257c (patch)
treeea0fe36eb5e6f40e0a1f765d44c4b0c0b2bfb089 /extra/git-post-commit.sh
parentInitial commit. (diff)
downloadbash-completion-6c18848a903eb3ee06dccd915859ce64195c257c.tar.xz
bash-completion-6c18848a903eb3ee06dccd915859ce64195c257c.zip
Adding upstream version 1:2.11.upstream/1%2.11
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'extra/git-post-commit.sh')
-rwxr-xr-xextra/git-post-commit.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/extra/git-post-commit.sh b/extra/git-post-commit.sh
new file mode 100755
index 0000000..e74c294
--- /dev/null
+++ b/extra/git-post-commit.sh
@@ -0,0 +1,23 @@
+#!/bin/sh -e
+
+# Post-commit hook for triggering bash-completion Docker Hub test image
+# builds at https://hub.docker.com/r/vskytta/bash-completion/
+#
+# To enable: ln -s ../../extra/git-post-commit.sh .git/hooks/post-commit
+#
+# The bash-completion.docker-hub-trigger-url config option must be set to
+# the full Docker Hub build trigger URL to hit.
+
+url=$(git config bash-completion.docker-hub-trigger-url)
+
+test "$(git symbolic-ref --short HEAD 2>/dev/null)" = master
+
+git diff-tree -r --name-only --no-commit-id HEAD |
+ grep -qxE 'test/test-cmd-list\.txt'
+
+curl \
+ --silent --show-error \
+ --max-time 30 \
+ --header Content-Type:application/json \
+ --data '{"build":true}' \
+ $url >/dev/null