From 95a33855d1b0363057112d3470dfb5d980c58eb5 Mon Sep 17 00:00:00 2001 From: Phantasm Date: Fri, 24 Apr 2026 22:02:01 +0200 Subject: [PATCH] pleroma_ctl: Update update logic to Gitea API --- rel/files/bin/pleroma_ctl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rel/files/bin/pleroma_ctl b/rel/files/bin/pleroma_ctl index 56dc13a06..2e114ff50 100755 --- a/rel/files/bin/pleroma_ctl +++ b/rel/files/bin/pleroma_ctl @@ -78,12 +78,17 @@ update() { RELEASE_ROOT=$(dirname "$SCRIPTPATH") uri="https://git.pleroma.social" - project_id="2" + project_name="pleroma" + api_base="${uri}/api/v1/packages/${project_name}/generic" + package_base="${uri}/api/packages/${project_name}/generic" project_branch="${BRANCH:-$(detect_branch)}" flavour="${FLAVOUR:-$(detect_flavour)}" + # API responds in JSON, optimistically try to make it one object per line + ver=$(curl -s "${api_base}"/pleroma-otp-"${project_branch}"-"${flavour}"/-/latest | tr ',' '\n' | grep '"version":' | cut -d':' -f2 | tr -d '"') + file=$(curl -s "${api_base}"/pleroma-otp-"${project_branch}"-"${flavour}"/"${ver}"/files | tr ',' '\n' | grep '"name":' | cut -d':' -f2 | tr -d '"') + full_uri=${FULL_URI:-"${package_base}"/pleroma-otp-"${project_branch}"-"${flavour}"/"${ver}"/"${file}"} tmp="${TMP_DIR:-/tmp}" artifact="$tmp/pleroma.zip" - full_uri="${FULL_URI:-${uri}/api/v4/projects/${project_id}/jobs/artifacts/${project_branch}/download?job=${flavour}}" echo "Downloading the artifact from ${full_uri} to ${artifact}" curl "$full_uri" -o "${artifact}" echo "Unpacking ${artifact} to ${tmp}"