Marcel Telka
2024-04-05 f228266143fa00a0d993ef25540014f5fea6ca10
commit | author | age
6858a6 1 #!/bin/sh
JK 2
3 # Find the latest (tarball) release under original site
4 #
382c2e 5 # Copyright 2016-2023 Jim Klimov
6858a6 6 #
JK 7
70cce8 8 BASE_URL="https://get.jenkins.io/war-stable/"
df6c7a 9 DL_PAGE_URL="https://www.jenkins.io/download/"
6858a6 10
JK 11 echo "=== Checking latest numbered release under $BASE_URL..."
382c2e 12 UPSTREAM_VERSION="`wget -q -O - "$BASE_URL" 2>/dev/null | egrep 'href="[0-9]*\.[0-9]*\.[0-9]*/"' | grep -vw latest | sed 's,^.*a href="\([0-9]*\.[0-9]*\.[0-9]*\)/*".*,\1,' | sort -t. -k1n,1n -k2n,2n -k3n,3n | tail -1`" \
df6c7a 13     && [ -n "$UPSTREAM_VERSION" ] && echo "Latest UPSTREAM_VERSION   = $UPSTREAM_VERSION" \
JK 14     || echo "WARNING: Could not fetch an UPSTREAM_VERSION, check manually at $DL_PAGE_URL " >&2
6858a6 15
df6c7a 16 UPSTREAM_CHECKSUM="`wget -O - "$BASE_URL/latest/jenkins.war.sha256" 2>/dev/null | awk '{print $1}'`" \
JK 17     && [ -n "$UPSTREAM_CHECKSUM" ] && echo "Latest SHA256SUM = sha256:$UPSTREAM_CHECKSUM" \
18     || echo "WARNING: Could not fetch an UPSTREAM_CHECKSUM" >&2
6858a6 19
df6c7a 20 MF="`dirname $0`/Makefile"
JK 21 echo "=== Data in current ${MF}:"
22 egrep '(^[\t\ ]*(COMPONENT_[A-Z]*_VERSION.*=|JENKINS_RELEASE.*=)|sha256:)' "${MF}"
23 MAKEFILE_CHECKSUM="`grep 'sha256:' ${MF} | sed 's,^.*sha256:,,'`"
24
25 if [ "$MAKEFILE_CHECKSUM" = "$UPSTREAM_CHECKSUM" ] ; then
26     echo "=== MAKEFILE_CHECKSUM matches the UPSTREAM_CHECKSUM currently"
27 fi
a6176b 28
382c2e 29 echo "=== Please edit the Makefile and commit like this (if needed):"
df6c7a 30 echo "    git add -p Makefile; git commit -m 'Bump jenkins-core-lts to v${UPSTREAM_VERSION}'"