File: git-post-commit.sh

package info (click to toggle)
bash-completion 1%3A2.11-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,560 kB
  • sloc: python: 8,228; makefile: 1,766; sh: 275; perl: 85; xml: 29; ansic: 7; ruby: 2
file content (23 lines) | stat: -rwxr-xr-x 710 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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