1 | 1 |
new file mode 100755 |
... | ... |
@@ -0,0 +1,15 @@ |
1 |
+#!/bin/sh |
|
2 |
+set -euC |
|
3 |
+ |
|
4 |
+# https://gitolite.com/gitolite/dev-notes.html#environment-variables-and-other-inputs |
|
5 |
+# https://plugins.jenkins.io/git/#push-notification-from-repository |
|
6 |
+ |
|
7 |
+gitolite_url="https://git.$(dnsdomainname)/$GL_REPO" |
|
8 |
+jenkins_url="${JENKINS_URL:-"https://jenkins.$(dnsdomainname)"}" |
|
9 |
+notify_url="$jenkins_url/git/notifyCommit?url=$gitolite_url" |
|
10 |
+connect_timeout="5" |
|
11 |
+ |
|
12 |
+if ! curl --connect-timeout "$connect_timeout" "$notify_url" |
|
13 |
+then |
|
14 |
+ printf "Failed to notify '$notify_url'.\\n" |
|
15 |
+fi |