[SCM] postgis.net branch check-md5 created. clarity-final-95-g540a900
git at osgeo.org
git at osgeo.org
Fri May 31 05:44:30 PDT 2024
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "postgis.net".
The branch, check-md5 has been created
at 540a9002ff7a4ae3d2411955d315a94a7a7602b6 (commit)
- Log -----------------------------------------------------------------
commit 540a9002ff7a4ae3d2411955d315a94a7a7602b6
Author: Sandro Santilli <strk at kbt.io>
Date: Fri May 31 14:44:13 2024 +0200
Add md5 checker step
diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml
index 3bb9d76..8ad34d8 100644
--- a/.woodpecker/build.yml
+++ b/.woodpecker/build.yml
@@ -1,9 +1,10 @@
-when:
- event: [push, pull_request]
-
steps:
build:
image: hugomods/hugo
commands:
- hugo
+
+ check-md5:
+ commands:
+ - utils/check_releases_md5.sh $(jq -r '.params.postgis.releases[] | select( .is_dev != true ) | .tag' config.json)
diff --git a/utils/check_releases_md5.sh b/utils/check_releases_md5.sh
new file mode 100755
index 0000000..df0b7fe
--- /dev/null
+++ b/utils/check_releases_md5.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+WORKDIR=$PWD/releases-check
+API=https://git.osgeo.org/gitea/api/v1
+DOWNLOAD_BASE=https://download.osgeo.org/postgis/source
+MD5_BASE=https://postgis.net/stuff
+OLDEST_MAJ=3
+
+mkdir -p ${WORKDIR}
+cd ${WORKDIR}
+
+if test -n '$@'; then
+ echo $@ | tr ' ' '\n' > checked_releases.txt
+else
+ echo "Fetching list of supported releases"
+ curl -s ${API}/repos/postgis/postgis/tags > tags.json
+ jq -r .[].name tags.json |
+ grep "^${OLDEST_MAJ}\." |
+ grep -v [a-z] > checked_releases.txt
+fi
+
+while read REL; do
+ relname=postgis-${REL}.tar.gz
+ md5name=${relname}.md5
+
+ echo -n "Checking ${relname} ... "
+ curl -s ${DOWNLOAD_BASE}/${relname} -o ${relname} || {
+ echo "unable to download ${relname} from ${DOWNLOAD_BASE}"
+ continue
+ }
+ curl -s ${MD5_BASE}/${md5name} -o ${md5name} || {
+ echo "unable to download ${md5name} from ${MD5_BASE}"
+ continue
+ }
+ md5sum ${relname} | diff - ${md5name} > /dev/null 2>&1 || {
+ echo "MD5 mismatch"
+ continue
+ }
+ echo "OK"
+done < checked_releases.txt
-----------------------------------------------------------------------
hooks/post-receive
--
postgis.net
More information about the postgis-tickets
mailing list