3 # Called by "git receive-pack" with arguments: refname sha1-old sha1-new
4 # To enable this hook, rename this file to "update".
12 if [[ -z "$GIT_DIR" ]]
14 echo "Don't run this script from the command line." >&2
15 echo " (if you want, you could supply GIT_DIR then run" >&2
16 echo " $0 <ref> <oldrev> <newrev>)" >&2
20 if [[ -z "$refname" ]] || [[ -z "$oldrev" ]] || [[ -z "$newrev" ]]
22 echo "usage: $0 <ref> <oldrev> <newrev>" >&2
26 # --- Upon branch update, build gitweb snapshot URI
27 # TODO: get project name based on current directory name
28 project_name=wolf-seeking-sheep
29 snapshot_uri=https://git.purplebirdman.com/${project_name}.git/snapshot/${newrev}.tar.gz
30 echo "Snapshot URI - https://git.purplebirdman.com/${project_name}.git/snapshot/${newrev}.tar.gz"
32 # --- Now send request to builder service
33 godot_builder_uri=https://godot.purplebirdman.com/hook/make-build-request.lua
35 echo "Sending build request..."
36 curl -Ss --get --data-urlencode "snapshot_uri=${snapshot_uri}" $godot_builder_uri