From af9ea57143fa7abeb188a0f598dfbcf6136d367a Mon Sep 17 00:00:00 2001 From: Clifton Palmer Date: Wed, 19 Mar 2025 07:04:46 -0500 Subject: [PATCH] Initial version --- update-godot-builder.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 update-godot-builder.sh diff --git a/update-godot-builder.sh b/update-godot-builder.sh new file mode 100755 index 0000000..d85754c --- /dev/null +++ b/update-godot-builder.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new +# To enable this hook, rename this file to "update". + +# --- Command line +refname="$1" +oldrev="$2" +newrev="$3" + +# --- Safety check +if [[ -z "$GIT_DIR" ]] +then + echo "Don't run this script from the command line." >&2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [[ -z "$refname" ]] || [[ -z "$oldrev" ]] || [[ -z "$newrev" ]] +then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Upon branch update, build gitweb snapshot URI +# TODO: get project name based on current directory name +project_name=wolf-seeking-sheep +snapshot_uri=https://git.purplebirdman.com/${project_name}.git/snapshot/${newrev}.tar.gz +echo "Snapshot URI - https://git.purplebirdman.com/${project_name}.git/snapshot/${newrev}.tar.gz" + +# --- Now send request to builder service +godot_builder_uri=https://godot.purplebirdman.com/hook/make-build-request.lua + +echo "Sending build request..." +curl -Ss --get --data-urlencode "snapshot_uri=${snapshot_uri}" $godot_builder_uri + +exit 0 -- 2.47.2