summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-11-20 11:38:39 +0100
committerLars Wirzenius <liw@liw.fi>2017-11-20 11:38:39 +0100
commit2731f8dea769094502d9fd89d93a3465c51fd4ae (patch)
tree5fae8e8fa777b26dd70a869b942a73175e5bf98d
parentfb92c10f0cf8ff83d1192ecdfd51510a3669c629 (diff)
downloadick.liw.fi-2731f8dea769094502d9fd89d93a3465c51fd4ae.tar.gz
Add: post-receive hook
-rwxr-xr-xhooks/post-receive.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/hooks/post-receive.lua b/hooks/post-receive.lua
new file mode 100755
index 0000000..89c9537
--- /dev/null
+++ b/hooks/post-receive.lua
@@ -0,0 +1,11 @@
+#!/usr/bin/lua
+local _, updates = ...
+if updates["refs/heads/master"] then
+ log.state("Notifying CI system, please hold...")
+ local code, msg, headers, body = fetch("https://ci1.liw.fi/projects/ick.liw.fi/pipelines/build/+trigger")
+ if code == "200" then
+ log.state("CI triggered")
+ else
+ log.warn("CI not triggered, received HTTP code " .. code)
+ end
+end