3 # Find the latest (tarball) release under original site
5 # Copyright 2016-2023 Jim Klimov
8 BASE_URL
="https://get.jenkins.io/war-stable/"
9 DL_PAGE_URL
="https://www.jenkins.io/download/"
11 echo "=== Checking latest numbered release under $BASE_URL..."
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`" \
13 && [ -n "$UPSTREAM_VERSION" ] && echo "Latest UPSTREAM_VERSION = $UPSTREAM_VERSION" \
14 ||
echo "WARNING: Could not fetch an UPSTREAM_VERSION, check manually at $DL_PAGE_URL " >&2
16 UPSTREAM_CHECKSUM
="`wget -O - "$BASE_URL/latest
/jenkins.war.sha256
" 2>/dev/null | awk '{print $1}'`" \
17 && [ -n "$UPSTREAM_CHECKSUM" ] && echo "Latest SHA256SUM = sha256:$UPSTREAM_CHECKSUM" \
18 ||
echo "WARNING: Could not fetch an UPSTREAM_CHECKSUM" >&2
20 MF
="`dirname $0`/Makefile"
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:,,'`"
25 if [ "$MAKEFILE_CHECKSUM" = "$UPSTREAM_CHECKSUM" ] ; then
26 echo "=== MAKEFILE_CHECKSUM matches the UPSTREAM_CHECKSUM currently"
29 echo "=== Please edit the Makefile and commit like this (if needed):"
30 echo " git add -p Makefile; git commit -m 'Bump jenkins-core-lts to v${UPSTREAM_VERSION}'"