From d1991183957090a453108700dbb048f7efec45e9 Mon Sep 17 00:00:00 2001 From: Gregory Bartholomew Date: Nov 20 2021 01:53:30 +0000 Subject: Update current-release.json on every publish --- diff --git a/html/Makefile b/html/Makefile index 5b17375..4441817 100644 --- a/html/Makefile +++ b/html/Makefile @@ -8,5 +8,10 @@ DESTINATION = fedorapeople.org:/project/schedule # rsync options - to make sure we copy the files with usable permissions, etc RSYNC_OPTIONS = -rltgov --chmod=D775,F664 +# current release - attempt to derive the current release from the contents of index.html +CURRENT_RELEASE := $(shell grep 'class="current"' index.html | sed 's/<[^>]*>//g') +CURRENT_RELEASE_FILE := current-release.json + publish: - @rsync ${RSYNC_OPTIONS} index.html fedora-schedule.css ${DESTINATION}/ + @echo '{ "NAME": "$(wordlist 1,2,${CURRENT_RELEASE})", "VERSION_ID": $(word 3,${CURRENT_RELEASE}) }' > ${CURRENT_RELEASE_FILE} + @rsync ${RSYNC_OPTIONS} index.html fedora-schedule.css ${CURRENT_RELEASE_FILE} ${DESTINATION}/