diff --git a/add-version-client.sh b/add-version-client.sh new file mode 100755 index 00000000..9d334d71 --- /dev/null +++ b/add-version-client.sh @@ -0,0 +1,30 @@ +#!/bin/bash -e + +VERSION=$1 +if [ "$VERSION" == "" ]; then + echo "usage: add-version-client.sh VERSION" + exit 1 +fi + +VERSION_NAME=`echo $VERSION | sed 's/.Final//' | sed 's/.CR[[:digit:]]//'` +DATE=`date +%F` + +if [[ "$VERSION" == *".0" ]]; then + TEMPLATE="version-template.json" +else + TEMPLATE="versions/keycloak-client/${VERSION%.*}.0.json" +fi + +if [ ! -f "$TEMPLATE" ]; then + echo "$TEMPLATE not found" + exit +fi + +cat $TEMPLATE | sed "s/\"version\":.*/\"version\": \"$VERSION\",/" | sed 's/"date": ".*"/"date": "DATE"/' | sed "s/DATE/$DATE/" > versions/keycloak-client/$VERSION_NAME.json + +CURRENT=`cat pom.xml | grep '' | cut -d '>' -f 2 | cut -d '<' -f 1` +LATEST=`echo -e "$CURRENT\n$VERSION" | sort -V -r | head -n 1` + +sed -i "s|$CURRENT|$LATEST|g" pom.xml + +mvn install diff --git a/add-version.sh b/add-version.sh index 3171e20d..3ef0e86e 100755 --- a/add-version.sh +++ b/add-version.sh @@ -9,10 +9,10 @@ fi VERSION_NAME=`echo $VERSION | sed 's/.Final//' | sed 's/.CR[[:digit:]]//'` DATE=`date +%F` -if [[ "$VERSION" == *".0" ]]; then +if [[ "$VERSION" == *".0" ]]; then TEMPLATE="version-template.json" else - TEMPLATE="versions/${VERSION%.*}.0.json" + TEMPLATE="versions/keycloak/{VERSION%.*}.0.json" fi if [ ! -f "$TEMPLATE" ]; then @@ -20,7 +20,7 @@ if [ ! -f "$TEMPLATE" ]; then exit fi -cat $TEMPLATE | sed "s/\"version\":.*/\"version\": \"$VERSION\",/" | sed 's/"date": ".*"/"date": "DATE"/' | sed "s/DATE/$DATE/" > versions/$VERSION_NAME.json +cat $TEMPLATE | sed "s/\"version\":.*/\"version\": \"$VERSION\",/" | sed 's/"date": ".*"/"date": "DATE"/' | sed "s/DATE/$DATE/" > versions/keycloak/$VERSION_NAME.json CURRENT=`cat pom.xml | grep '' | cut -d '>' -f 2 | cut -d '<' -f 1` LATEST=`echo -e "$CURRENT\n$VERSION" | sort -V -r | head -n 1` diff --git a/cache/releases/21.0.0/changelog.json b/cache/releases/keycloak/21.0.0/changelog.json similarity index 100% rename from cache/releases/21.0.0/changelog.json rename to cache/releases/keycloak/21.0.0/changelog.json diff --git a/cache/releases/21.0.0/release-notes.empty b/cache/releases/keycloak/21.0.0/release-notes.empty similarity index 100% rename from cache/releases/21.0.0/release-notes.empty rename to cache/releases/keycloak/21.0.0/release-notes.empty diff --git a/cache/releases/21.0.1/changelog.json b/cache/releases/keycloak/21.0.1/changelog.json similarity index 100% rename from cache/releases/21.0.1/changelog.json rename to cache/releases/keycloak/21.0.1/changelog.json diff --git a/cache/releases/21.0.1/release-notes.empty b/cache/releases/keycloak/21.0.1/release-notes.empty similarity index 100% rename from cache/releases/21.0.1/release-notes.empty rename to cache/releases/keycloak/21.0.1/release-notes.empty diff --git a/cache/releases/21.0.2/changelog.json b/cache/releases/keycloak/21.0.2/changelog.json similarity index 100% rename from cache/releases/21.0.2/changelog.json rename to cache/releases/keycloak/21.0.2/changelog.json diff --git a/cache/releases/21.0.2/release-notes.empty b/cache/releases/keycloak/21.0.2/release-notes.empty similarity index 100% rename from cache/releases/21.0.2/release-notes.empty rename to cache/releases/keycloak/21.0.2/release-notes.empty diff --git a/cache/releases/21.1.0/changelog.json b/cache/releases/keycloak/21.1.0/changelog.json similarity index 100% rename from cache/releases/21.1.0/changelog.json rename to cache/releases/keycloak/21.1.0/changelog.json diff --git a/cache/releases/21.1.0/release-notes.html b/cache/releases/keycloak/21.1.0/release-notes.html similarity index 100% rename from cache/releases/21.1.0/release-notes.html rename to cache/releases/keycloak/21.1.0/release-notes.html diff --git a/cache/releases/21.1.1/changelog.json b/cache/releases/keycloak/21.1.1/changelog.json similarity index 100% rename from cache/releases/21.1.1/changelog.json rename to cache/releases/keycloak/21.1.1/changelog.json diff --git a/cache/releases/21.1.1/release-notes.empty b/cache/releases/keycloak/21.1.1/release-notes.empty similarity index 100% rename from cache/releases/21.1.1/release-notes.empty rename to cache/releases/keycloak/21.1.1/release-notes.empty diff --git a/cache/releases/21.1.2/changelog.json b/cache/releases/keycloak/21.1.2/changelog.json similarity index 100% rename from cache/releases/21.1.2/changelog.json rename to cache/releases/keycloak/21.1.2/changelog.json diff --git a/cache/releases/21.1.2/release-notes.html b/cache/releases/keycloak/21.1.2/release-notes.html similarity index 100% rename from cache/releases/21.1.2/release-notes.html rename to cache/releases/keycloak/21.1.2/release-notes.html diff --git a/cache/releases/22.0.0/changelog.json b/cache/releases/keycloak/22.0.0/changelog.json similarity index 100% rename from cache/releases/22.0.0/changelog.json rename to cache/releases/keycloak/22.0.0/changelog.json diff --git a/cache/releases/22.0.0/release-notes.html b/cache/releases/keycloak/22.0.0/release-notes.html similarity index 100% rename from cache/releases/22.0.0/release-notes.html rename to cache/releases/keycloak/22.0.0/release-notes.html diff --git a/cache/releases/22.0.1/changelog.json b/cache/releases/keycloak/22.0.1/changelog.json similarity index 100% rename from cache/releases/22.0.1/changelog.json rename to cache/releases/keycloak/22.0.1/changelog.json diff --git a/cache/releases/22.0.1/release-notes.empty b/cache/releases/keycloak/22.0.1/release-notes.empty similarity index 100% rename from cache/releases/22.0.1/release-notes.empty rename to cache/releases/keycloak/22.0.1/release-notes.empty diff --git a/cache/releases/22.0.2/changelog.json b/cache/releases/keycloak/22.0.2/changelog.json similarity index 100% rename from cache/releases/22.0.2/changelog.json rename to cache/releases/keycloak/22.0.2/changelog.json diff --git a/cache/releases/22.0.2/release-notes.html b/cache/releases/keycloak/22.0.2/release-notes.html similarity index 100% rename from cache/releases/22.0.2/release-notes.html rename to cache/releases/keycloak/22.0.2/release-notes.html diff --git a/cache/releases/22.0.3/changelog.json b/cache/releases/keycloak/22.0.3/changelog.json similarity index 100% rename from cache/releases/22.0.3/changelog.json rename to cache/releases/keycloak/22.0.3/changelog.json diff --git a/cache/releases/22.0.3/release-notes.html b/cache/releases/keycloak/22.0.3/release-notes.html similarity index 100% rename from cache/releases/22.0.3/release-notes.html rename to cache/releases/keycloak/22.0.3/release-notes.html diff --git a/cache/releases/22.0.4/changelog.json b/cache/releases/keycloak/22.0.4/changelog.json similarity index 100% rename from cache/releases/22.0.4/changelog.json rename to cache/releases/keycloak/22.0.4/changelog.json diff --git a/cache/releases/22.0.4/release-notes.empty b/cache/releases/keycloak/22.0.4/release-notes.empty similarity index 100% rename from cache/releases/22.0.4/release-notes.empty rename to cache/releases/keycloak/22.0.4/release-notes.empty diff --git a/cache/releases/22.0.5/changelog.json b/cache/releases/keycloak/22.0.5/changelog.json similarity index 100% rename from cache/releases/22.0.5/changelog.json rename to cache/releases/keycloak/22.0.5/changelog.json diff --git a/cache/releases/22.0.5/release-notes.empty b/cache/releases/keycloak/22.0.5/release-notes.empty similarity index 100% rename from cache/releases/22.0.5/release-notes.empty rename to cache/releases/keycloak/22.0.5/release-notes.empty diff --git a/cache/releases/23.0.0/changelog.json b/cache/releases/keycloak/23.0.0/changelog.json similarity index 100% rename from cache/releases/23.0.0/changelog.json rename to cache/releases/keycloak/23.0.0/changelog.json diff --git a/cache/releases/23.0.0/gh-release-notes.html b/cache/releases/keycloak/23.0.0/gh-release-notes.html similarity index 100% rename from cache/releases/23.0.0/gh-release-notes.html rename to cache/releases/keycloak/23.0.0/gh-release-notes.html diff --git a/cache/releases/23.0.0/release-notes.html b/cache/releases/keycloak/23.0.0/release-notes.html similarity index 100% rename from cache/releases/23.0.0/release-notes.html rename to cache/releases/keycloak/23.0.0/release-notes.html diff --git a/cache/releases/23.0.1/changelog.json b/cache/releases/keycloak/23.0.1/changelog.json similarity index 100% rename from cache/releases/23.0.1/changelog.json rename to cache/releases/keycloak/23.0.1/changelog.json diff --git a/cache/releases/23.0.1/gh-release-notes.html b/cache/releases/keycloak/23.0.1/gh-release-notes.html similarity index 100% rename from cache/releases/23.0.1/gh-release-notes.html rename to cache/releases/keycloak/23.0.1/gh-release-notes.html diff --git a/cache/releases/23.0.1/release-notes.empty b/cache/releases/keycloak/23.0.1/release-notes.empty similarity index 100% rename from cache/releases/23.0.1/release-notes.empty rename to cache/releases/keycloak/23.0.1/release-notes.empty diff --git a/cache/releases/23.0.2/changelog.json b/cache/releases/keycloak/23.0.2/changelog.json similarity index 100% rename from cache/releases/23.0.2/changelog.json rename to cache/releases/keycloak/23.0.2/changelog.json diff --git a/cache/releases/23.0.2/gh-release-notes.html b/cache/releases/keycloak/23.0.2/gh-release-notes.html similarity index 100% rename from cache/releases/23.0.2/gh-release-notes.html rename to cache/releases/keycloak/23.0.2/gh-release-notes.html diff --git a/cache/releases/23.0.2/release-notes.html b/cache/releases/keycloak/23.0.2/release-notes.html similarity index 100% rename from cache/releases/23.0.2/release-notes.html rename to cache/releases/keycloak/23.0.2/release-notes.html diff --git a/cache/releases/23.0.3/changelog.json b/cache/releases/keycloak/23.0.3/changelog.json similarity index 100% rename from cache/releases/23.0.3/changelog.json rename to cache/releases/keycloak/23.0.3/changelog.json diff --git a/cache/releases/23.0.3/gh-release-notes.html b/cache/releases/keycloak/23.0.3/gh-release-notes.html similarity index 100% rename from cache/releases/23.0.3/gh-release-notes.html rename to cache/releases/keycloak/23.0.3/gh-release-notes.html diff --git a/cache/releases/23.0.3/release-notes.empty b/cache/releases/keycloak/23.0.3/release-notes.empty similarity index 100% rename from cache/releases/23.0.3/release-notes.empty rename to cache/releases/keycloak/23.0.3/release-notes.empty diff --git a/cache/releases/23.0.4/changelog.json b/cache/releases/keycloak/23.0.4/changelog.json similarity index 100% rename from cache/releases/23.0.4/changelog.json rename to cache/releases/keycloak/23.0.4/changelog.json diff --git a/cache/releases/23.0.4/gh-release-notes.html b/cache/releases/keycloak/23.0.4/gh-release-notes.html similarity index 100% rename from cache/releases/23.0.4/gh-release-notes.html rename to cache/releases/keycloak/23.0.4/gh-release-notes.html diff --git a/cache/releases/23.0.4/release-notes.empty b/cache/releases/keycloak/23.0.4/release-notes.empty similarity index 100% rename from cache/releases/23.0.4/release-notes.empty rename to cache/releases/keycloak/23.0.4/release-notes.empty diff --git a/cache/releases/23.0.5/changelog.json b/cache/releases/keycloak/23.0.5/changelog.json similarity index 100% rename from cache/releases/23.0.5/changelog.json rename to cache/releases/keycloak/23.0.5/changelog.json diff --git a/cache/releases/23.0.5/gh-release-notes.html b/cache/releases/keycloak/23.0.5/gh-release-notes.html similarity index 100% rename from cache/releases/23.0.5/gh-release-notes.html rename to cache/releases/keycloak/23.0.5/gh-release-notes.html diff --git a/cache/releases/23.0.5/release-notes.empty b/cache/releases/keycloak/23.0.5/release-notes.empty similarity index 100% rename from cache/releases/23.0.5/release-notes.empty rename to cache/releases/keycloak/23.0.5/release-notes.empty diff --git a/cache/releases/23.0.6/changelog.json b/cache/releases/keycloak/23.0.6/changelog.json similarity index 100% rename from cache/releases/23.0.6/changelog.json rename to cache/releases/keycloak/23.0.6/changelog.json diff --git a/cache/releases/23.0.6/gh-release-notes.html b/cache/releases/keycloak/23.0.6/gh-release-notes.html similarity index 100% rename from cache/releases/23.0.6/gh-release-notes.html rename to cache/releases/keycloak/23.0.6/gh-release-notes.html diff --git a/cache/releases/23.0.6/release-notes.empty b/cache/releases/keycloak/23.0.6/release-notes.empty similarity index 100% rename from cache/releases/23.0.6/release-notes.empty rename to cache/releases/keycloak/23.0.6/release-notes.empty diff --git a/cache/releases/23.0.7/changelog.json b/cache/releases/keycloak/23.0.7/changelog.json similarity index 100% rename from cache/releases/23.0.7/changelog.json rename to cache/releases/keycloak/23.0.7/changelog.json diff --git a/cache/releases/23.0.7/gh-release-notes.html b/cache/releases/keycloak/23.0.7/gh-release-notes.html similarity index 100% rename from cache/releases/23.0.7/gh-release-notes.html rename to cache/releases/keycloak/23.0.7/gh-release-notes.html diff --git a/cache/releases/23.0.7/release-notes.empty b/cache/releases/keycloak/23.0.7/release-notes.empty similarity index 100% rename from cache/releases/23.0.7/release-notes.empty rename to cache/releases/keycloak/23.0.7/release-notes.empty diff --git a/cache/releases/24.0.0/changelog.json b/cache/releases/keycloak/24.0.0/changelog.json similarity index 100% rename from cache/releases/24.0.0/changelog.json rename to cache/releases/keycloak/24.0.0/changelog.json diff --git a/cache/releases/24.0.0/gh-release-notes.html b/cache/releases/keycloak/24.0.0/gh-release-notes.html similarity index 100% rename from cache/releases/24.0.0/gh-release-notes.html rename to cache/releases/keycloak/24.0.0/gh-release-notes.html diff --git a/cache/releases/24.0.0/release-notes.html b/cache/releases/keycloak/24.0.0/release-notes.html similarity index 100% rename from cache/releases/24.0.0/release-notes.html rename to cache/releases/keycloak/24.0.0/release-notes.html diff --git a/cache/releases/24.0.1/changelog.json b/cache/releases/keycloak/24.0.1/changelog.json similarity index 100% rename from cache/releases/24.0.1/changelog.json rename to cache/releases/keycloak/24.0.1/changelog.json diff --git a/cache/releases/24.0.1/gh-release-notes.html b/cache/releases/keycloak/24.0.1/gh-release-notes.html similarity index 100% rename from cache/releases/24.0.1/gh-release-notes.html rename to cache/releases/keycloak/24.0.1/gh-release-notes.html diff --git a/cache/releases/24.0.1/release-notes.html b/cache/releases/keycloak/24.0.1/release-notes.html similarity index 100% rename from cache/releases/24.0.1/release-notes.html rename to cache/releases/keycloak/24.0.1/release-notes.html diff --git a/cache/releases/24.0.2/changelog.json b/cache/releases/keycloak/24.0.2/changelog.json similarity index 100% rename from cache/releases/24.0.2/changelog.json rename to cache/releases/keycloak/24.0.2/changelog.json diff --git a/cache/releases/24.0.2/gh-release-notes.html b/cache/releases/keycloak/24.0.2/gh-release-notes.html similarity index 100% rename from cache/releases/24.0.2/gh-release-notes.html rename to cache/releases/keycloak/24.0.2/gh-release-notes.html diff --git a/cache/releases/24.0.2/release-notes.empty b/cache/releases/keycloak/24.0.2/release-notes.empty similarity index 100% rename from cache/releases/24.0.2/release-notes.empty rename to cache/releases/keycloak/24.0.2/release-notes.empty diff --git a/cache/releases/24.0.3/changelog.json b/cache/releases/keycloak/24.0.3/changelog.json similarity index 100% rename from cache/releases/24.0.3/changelog.json rename to cache/releases/keycloak/24.0.3/changelog.json diff --git a/cache/releases/24.0.3/gh-release-notes.html b/cache/releases/keycloak/24.0.3/gh-release-notes.html similarity index 100% rename from cache/releases/24.0.3/gh-release-notes.html rename to cache/releases/keycloak/24.0.3/gh-release-notes.html diff --git a/cache/releases/24.0.3/release-notes.empty b/cache/releases/keycloak/24.0.3/release-notes.empty similarity index 100% rename from cache/releases/24.0.3/release-notes.empty rename to cache/releases/keycloak/24.0.3/release-notes.empty diff --git a/cache/releases/24.0.4/changelog.json b/cache/releases/keycloak/24.0.4/changelog.json similarity index 100% rename from cache/releases/24.0.4/changelog.json rename to cache/releases/keycloak/24.0.4/changelog.json diff --git a/cache/releases/24.0.4/gh-release-notes.html b/cache/releases/keycloak/24.0.4/gh-release-notes.html similarity index 100% rename from cache/releases/24.0.4/gh-release-notes.html rename to cache/releases/keycloak/24.0.4/gh-release-notes.html diff --git a/cache/releases/24.0.4/release-notes.html b/cache/releases/keycloak/24.0.4/release-notes.html similarity index 100% rename from cache/releases/24.0.4/release-notes.html rename to cache/releases/keycloak/24.0.4/release-notes.html diff --git a/cache/releases/24.0.5/changelog.json b/cache/releases/keycloak/24.0.5/changelog.json similarity index 100% rename from cache/releases/24.0.5/changelog.json rename to cache/releases/keycloak/24.0.5/changelog.json diff --git a/cache/releases/24.0.5/gh-release-notes.html b/cache/releases/keycloak/24.0.5/gh-release-notes.html similarity index 100% rename from cache/releases/24.0.5/gh-release-notes.html rename to cache/releases/keycloak/24.0.5/gh-release-notes.html diff --git a/cache/releases/24.0.5/release-notes.html b/cache/releases/keycloak/24.0.5/release-notes.html similarity index 100% rename from cache/releases/24.0.5/release-notes.html rename to cache/releases/keycloak/24.0.5/release-notes.html diff --git a/cache/releases/25.0.0/changelog.json b/cache/releases/keycloak/25.0.0/changelog.json similarity index 100% rename from cache/releases/25.0.0/changelog.json rename to cache/releases/keycloak/25.0.0/changelog.json diff --git a/cache/releases/25.0.0/gh-release-notes.html b/cache/releases/keycloak/25.0.0/gh-release-notes.html similarity index 100% rename from cache/releases/25.0.0/gh-release-notes.html rename to cache/releases/keycloak/25.0.0/gh-release-notes.html diff --git a/cache/releases/25.0.0/release-notes.html b/cache/releases/keycloak/25.0.0/release-notes.html similarity index 100% rename from cache/releases/25.0.0/release-notes.html rename to cache/releases/keycloak/25.0.0/release-notes.html diff --git a/cache/releases/25.0.1/changelog.json b/cache/releases/keycloak/25.0.1/changelog.json similarity index 100% rename from cache/releases/25.0.1/changelog.json rename to cache/releases/keycloak/25.0.1/changelog.json diff --git a/cache/releases/25.0.1/gh-release-notes.html b/cache/releases/keycloak/25.0.1/gh-release-notes.html similarity index 100% rename from cache/releases/25.0.1/gh-release-notes.html rename to cache/releases/keycloak/25.0.1/gh-release-notes.html diff --git a/cache/releases/25.0.1/release-notes.empty b/cache/releases/keycloak/25.0.1/release-notes.empty similarity index 100% rename from cache/releases/25.0.1/release-notes.empty rename to cache/releases/keycloak/25.0.1/release-notes.empty diff --git a/cache/releases/25.0.2/changelog.json b/cache/releases/keycloak/25.0.2/changelog.json similarity index 100% rename from cache/releases/25.0.2/changelog.json rename to cache/releases/keycloak/25.0.2/changelog.json diff --git a/cache/releases/25.0.2/gh-release-notes.html b/cache/releases/keycloak/25.0.2/gh-release-notes.html similarity index 100% rename from cache/releases/25.0.2/gh-release-notes.html rename to cache/releases/keycloak/25.0.2/gh-release-notes.html diff --git a/cache/releases/25.0.2/release-notes.empty b/cache/releases/keycloak/25.0.2/release-notes.empty similarity index 100% rename from cache/releases/25.0.2/release-notes.empty rename to cache/releases/keycloak/25.0.2/release-notes.empty diff --git a/cache/releases/25.0.4/changelog.json b/cache/releases/keycloak/25.0.4/changelog.json similarity index 100% rename from cache/releases/25.0.4/changelog.json rename to cache/releases/keycloak/25.0.4/changelog.json diff --git a/cache/releases/25.0.4/gh-release-notes.html b/cache/releases/keycloak/25.0.4/gh-release-notes.html similarity index 100% rename from cache/releases/25.0.4/gh-release-notes.html rename to cache/releases/keycloak/25.0.4/gh-release-notes.html diff --git a/cache/releases/25.0.4/release-notes.empty b/cache/releases/keycloak/25.0.4/release-notes.empty similarity index 100% rename from cache/releases/25.0.4/release-notes.empty rename to cache/releases/keycloak/25.0.4/release-notes.empty diff --git a/cache/releases/25.0.5/changelog.json b/cache/releases/keycloak/25.0.5/changelog.json similarity index 100% rename from cache/releases/25.0.5/changelog.json rename to cache/releases/keycloak/25.0.5/changelog.json diff --git a/cache/releases/25.0.5/gh-release-notes.html b/cache/releases/keycloak/25.0.5/gh-release-notes.html similarity index 100% rename from cache/releases/25.0.5/gh-release-notes.html rename to cache/releases/keycloak/25.0.5/gh-release-notes.html diff --git a/cache/releases/25.0.5/release-notes.empty b/cache/releases/keycloak/25.0.5/release-notes.empty similarity index 100% rename from cache/releases/25.0.5/release-notes.empty rename to cache/releases/keycloak/25.0.5/release-notes.empty diff --git a/cache/releases/25.0.6/changelog.json b/cache/releases/keycloak/25.0.6/changelog.json similarity index 100% rename from cache/releases/25.0.6/changelog.json rename to cache/releases/keycloak/25.0.6/changelog.json diff --git a/cache/releases/25.0.6/gh-release-notes.html b/cache/releases/keycloak/25.0.6/gh-release-notes.html similarity index 100% rename from cache/releases/25.0.6/gh-release-notes.html rename to cache/releases/keycloak/25.0.6/gh-release-notes.html diff --git a/cache/releases/25.0.6/release-notes.empty b/cache/releases/keycloak/25.0.6/release-notes.empty similarity index 100% rename from cache/releases/25.0.6/release-notes.empty rename to cache/releases/keycloak/25.0.6/release-notes.empty diff --git a/cache/releases/26.0.0/changelog.json b/cache/releases/keycloak/26.0.0/changelog.json similarity index 100% rename from cache/releases/26.0.0/changelog.json rename to cache/releases/keycloak/26.0.0/changelog.json diff --git a/cache/releases/26.0.0/gh-release-notes.html b/cache/releases/keycloak/26.0.0/gh-release-notes.html similarity index 100% rename from cache/releases/26.0.0/gh-release-notes.html rename to cache/releases/keycloak/26.0.0/gh-release-notes.html diff --git a/cache/releases/26.0.0/release-notes.html b/cache/releases/keycloak/26.0.0/release-notes.html similarity index 100% rename from cache/releases/26.0.0/release-notes.html rename to cache/releases/keycloak/26.0.0/release-notes.html diff --git a/cache/releases/26.0.1/changelog.json b/cache/releases/keycloak/26.0.1/changelog.json similarity index 100% rename from cache/releases/26.0.1/changelog.json rename to cache/releases/keycloak/26.0.1/changelog.json diff --git a/cache/releases/26.0.1/gh-release-notes.html b/cache/releases/keycloak/26.0.1/gh-release-notes.html similarity index 100% rename from cache/releases/26.0.1/gh-release-notes.html rename to cache/releases/keycloak/26.0.1/gh-release-notes.html diff --git a/cache/releases/26.0.1/release-notes.empty b/cache/releases/keycloak/26.0.1/release-notes.empty similarity index 100% rename from cache/releases/26.0.1/release-notes.empty rename to cache/releases/keycloak/26.0.1/release-notes.empty diff --git a/cache/releases/26.0.2/changelog.json b/cache/releases/keycloak/26.0.2/changelog.json similarity index 100% rename from cache/releases/26.0.2/changelog.json rename to cache/releases/keycloak/26.0.2/changelog.json diff --git a/cache/releases/26.0.2/gh-release-notes.html b/cache/releases/keycloak/26.0.2/gh-release-notes.html similarity index 100% rename from cache/releases/26.0.2/gh-release-notes.html rename to cache/releases/keycloak/26.0.2/gh-release-notes.html diff --git a/cache/releases/26.0.2/release-notes.empty b/cache/releases/keycloak/26.0.2/release-notes.empty similarity index 100% rename from cache/releases/26.0.2/release-notes.empty rename to cache/releases/keycloak/26.0.2/release-notes.empty diff --git a/cache/releases/26.0.4/changelog.json b/cache/releases/keycloak/26.0.4/changelog.json similarity index 100% rename from cache/releases/26.0.4/changelog.json rename to cache/releases/keycloak/26.0.4/changelog.json diff --git a/cache/releases/26.0.4/gh-release-notes.html b/cache/releases/keycloak/26.0.4/gh-release-notes.html similarity index 100% rename from cache/releases/26.0.4/gh-release-notes.html rename to cache/releases/keycloak/26.0.4/gh-release-notes.html diff --git a/cache/releases/26.0.4/release-notes.empty b/cache/releases/keycloak/26.0.4/release-notes.empty similarity index 100% rename from cache/releases/26.0.4/release-notes.empty rename to cache/releases/keycloak/26.0.4/release-notes.empty diff --git a/cache/releases/26.0.5/changelog.json b/cache/releases/keycloak/26.0.5/changelog.json similarity index 100% rename from cache/releases/26.0.5/changelog.json rename to cache/releases/keycloak/26.0.5/changelog.json diff --git a/cache/releases/26.0.5/gh-release-notes.html b/cache/releases/keycloak/26.0.5/gh-release-notes.html similarity index 100% rename from cache/releases/26.0.5/gh-release-notes.html rename to cache/releases/keycloak/26.0.5/gh-release-notes.html diff --git a/cache/releases/26.0.5/release-notes.html b/cache/releases/keycloak/26.0.5/release-notes.html similarity index 100% rename from cache/releases/26.0.5/release-notes.html rename to cache/releases/keycloak/26.0.5/release-notes.html diff --git a/cache/releases/26.0.6/changelog.json b/cache/releases/keycloak/26.0.6/changelog.json similarity index 100% rename from cache/releases/26.0.6/changelog.json rename to cache/releases/keycloak/26.0.6/changelog.json diff --git a/cache/releases/26.0.6/gh-release-notes.html b/cache/releases/keycloak/26.0.6/gh-release-notes.html similarity index 100% rename from cache/releases/26.0.6/gh-release-notes.html rename to cache/releases/keycloak/26.0.6/gh-release-notes.html diff --git a/cache/releases/26.0.6/release-notes.html b/cache/releases/keycloak/26.0.6/release-notes.html similarity index 100% rename from cache/releases/26.0.6/release-notes.html rename to cache/releases/keycloak/26.0.6/release-notes.html diff --git a/cache/releases/26.0.7/changelog.json b/cache/releases/keycloak/26.0.7/changelog.json similarity index 100% rename from cache/releases/26.0.7/changelog.json rename to cache/releases/keycloak/26.0.7/changelog.json diff --git a/cache/releases/26.0.7/gh-release-notes.html b/cache/releases/keycloak/26.0.7/gh-release-notes.html similarity index 100% rename from cache/releases/26.0.7/gh-release-notes.html rename to cache/releases/keycloak/26.0.7/gh-release-notes.html diff --git a/cache/releases/26.0.7/release-notes.empty b/cache/releases/keycloak/26.0.7/release-notes.empty similarity index 100% rename from cache/releases/26.0.7/release-notes.empty rename to cache/releases/keycloak/26.0.7/release-notes.empty diff --git a/releases.yaml b/releases.yaml new file mode 100644 index 00000000..f929976c --- /dev/null +++ b/releases.yaml @@ -0,0 +1,10 @@ +sources: + - id: keycloak + repo: keycloak/keycloak + releaseNotes: release/${version.getVersionShorter()}/docs/documentation/release_notes/topics/${version.getVersion()?replace(".", "_")}.adoc + attributeSources: + - release/${version.getVersionShorter()}/docs/documentation/topics/templates/document-attributes.adoc + - ${version.getVersion()}/docs/documentation/topics/templates/document-attributes.adoc + - id: keycloak-client + repo: keycloak/keycloak-client + releaseNotes: main/docs/release-notes/${version.getVersion()?replace(".", "_")}.adoc diff --git a/src/main/java/org/keycloak/webbuilder/Context.java b/src/main/java/org/keycloak/webbuilder/Context.java index 8519fb51..d4962b67 100644 --- a/src/main/java/org/keycloak/webbuilder/Context.java +++ b/src/main/java/org/keycloak/webbuilder/Context.java @@ -6,6 +6,7 @@ import org.keycloak.webbuilder.utils.YamlParser; import java.io.File; +import java.util.LinkedList; public class Context { @@ -16,6 +17,8 @@ public class Context { private final File resourcesDir; private final File staticDir; private final File versionsDir; + private final File keycloakVersionsDir; + private final File keycloakClientVersionsDir; private final File extensionsDir; private final File newsDir; private final File blogDir; @@ -25,11 +28,13 @@ public class Context { private final File cacheDir; private Config config; - private Versions versions; + private Versions keycloakVersions; + private Versions keycloakClientVersions; private Extensions extensions; private Blogs blogs; private Guides guides; private GuidesMetadata guidesMetadata; + private ReleasesMetadata releasesMetadata; private News news; private FreeMarker freeMarker; @@ -45,6 +50,8 @@ public Context(File rootDir) throws Exception { resourcesDir = new File(webSrcDir, "resources"); staticDir = new File(webSrcDir, "static"); versionsDir = new File(webSrcDir, "versions"); + keycloakVersionsDir = new File(versionsDir, "keycloak"); + keycloakClientVersionsDir = new File(versionsDir, "keycloak-client"); extensionsDir = new File(webSrcDir, "extensions"); newsDir = new File(webSrcDir, "news"); blogDir = new File(webSrcDir, "blog"); @@ -60,10 +67,12 @@ public void init() throws Exception { config = loadConfig(); links = new Links(config); - versions = new Versions(versionsDir); + keycloakVersions = new Versions(keycloakVersionsDir); + keycloakClientVersions = new Versions(keycloakClientVersionsDir); extensions = new Extensions(extensionsDir); - blogs = new Blogs(blogDir, versions, config, freeMarker, asciiDoctor); + blogs = new Blogs(blogDir, keycloakVersions, config, freeMarker, asciiDoctor); guidesMetadata = new YamlParser().read(new File(getWebSrcDir(),"/guides.yaml"), GuidesMetadata.class); + releasesMetadata = new YamlParser().read(new File(getWebSrcDir(),"/releases.yaml"), ReleasesMetadata.class); guides = new Guides(guidesMetadata, tmpDir, getWebSrcDir(), asciiDoctor); news = new News(newsDir, blogs, config); @@ -92,7 +101,22 @@ public Config config() { } public Versions versions() { - return versions; + return keycloakVersions; + } + + public LinkedList versionsFor(String id) throws Exception { + switch (id) { + case "keycloak": + return versions(); + case "keycloak-client": + return clientVersions(); + default: + throw new Exception(String.format("No versions available for %s", id)); + } + } + + public Versions clientVersions() { + return keycloakClientVersions; } public Extensions extensions() { @@ -159,6 +183,10 @@ public GuidesMetadata getGuidesMetadata() { return guidesMetadata; } + public ReleasesMetadata getReleasesMetadata() { + return releasesMetadata; + } + public File getGuidesDir() { return guidesDir; } diff --git a/src/main/java/org/keycloak/webbuilder/ReleasesMetadata.java b/src/main/java/org/keycloak/webbuilder/ReleasesMetadata.java new file mode 100644 index 00000000..97effe7c --- /dev/null +++ b/src/main/java/org/keycloak/webbuilder/ReleasesMetadata.java @@ -0,0 +1,54 @@ +package org.keycloak.webbuilder; + +import java.util.List; + +public class ReleasesMetadata { + public List sources; + + public List getSources() { + return sources; + } + + public void setSources(List sources) { + this.sources = sources; + } + + public static class ReleaseSource { + private String id; + private String repo; + private String releaseNotes; + private List attributeSources; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getRepo() { + return repo; + } + + public void setRepo(String repo) { + this.repo = repo; + } + + public String getReleaseNotes() { + return releaseNotes; + } + + public void setReleaseNotes(String releaseNotes) { + this.releaseNotes = releaseNotes; + } + + public List getAttributeSources() { + return attributeSources; + } + + public void setAttributeSources(List attributeSources) { + this.attributeSources = attributeSources; + } + } +} diff --git a/src/main/java/org/keycloak/webbuilder/builders/ReleaseNotesBuilder.java b/src/main/java/org/keycloak/webbuilder/builders/ReleaseNotesBuilder.java index 4846dfa9..d682b490 100644 --- a/src/main/java/org/keycloak/webbuilder/builders/ReleaseNotesBuilder.java +++ b/src/main/java/org/keycloak/webbuilder/builders/ReleaseNotesBuilder.java @@ -1,41 +1,50 @@ package org.keycloak.webbuilder.builders; +import freemarker.template.Configuration; +import freemarker.template.Template; +import org.keycloak.webbuilder.ReleasesMetadata; import org.keycloak.webbuilder.Versions; import java.io.File; import java.io.FileNotFoundException; -import java.io.IOException; +import java.io.StringWriter; import java.net.URL; import java.util.HashMap; +import java.util.List; import java.util.Map; public class ReleaseNotesBuilder extends AbstractBuilder { - private static final String DOCUMENT_ATTRIBUTES_TAG_URL = "https://raw.githubusercontent.com/keycloak/keycloak/%s/docs/documentation/topics/templates/document-attributes.adoc"; - private static final String DOCUMENT_ATTRIBUTES_BRANCH_URL = "https://raw.githubusercontent.com/keycloak/keycloak/release/%s/docs/documentation/topics/templates/document-attributes.adoc"; - - private static final String RELEASE_NOTES_URL = "https://raw.githubusercontent.com/keycloak/keycloak/release/%s/docs/documentation/release_notes/topics/%s.adoc"; - @Override protected String getTitle() { return "Release Notes"; } - public void build() throws IOException { - File releasesCache = new File(context.getCacheDir(), "releases"); + @Override + protected void build() throws Exception { + ReleasesMetadata metadata = context.getReleasesMetadata(); + + for (ReleasesMetadata.ReleaseSource source : metadata.getSources()) { + buildRelease(source); + } + } + + private void buildRelease(ReleasesMetadata.ReleaseSource source) throws Exception { + File releasesCache = new File(context.getCacheDir(), "releases/" + source.getId()); + List versions = context.versionsFor(source.getId()); - for (Versions.Version v : context.versions()) { + for (Versions.Version version : versions) { try { - File releaseCacheDir = new File(releasesCache, v.getVersion()); + File releaseCacheDir = new File(releasesCache, version.getVersion()); releaseCacheDir.mkdirs(); File releaseNotesFile = new File(releaseCacheDir, "release-notes.html"); File releaseNotesMissingFile = new File(releaseCacheDir, "release-notes.empty"); if (releaseNotesFile.isFile()) { - printStep("exists", v.getVersion()); + printStep("exists", source.getId() + " " + version.getVersion()); } else if (releaseNotesMissingFile.isFile()) { - printStep("missing", v.getVersion()); + printStep("missing", source.getId() + " " + version.getVersion()); } else { Map attributes = new HashMap<>(); @@ -43,31 +52,47 @@ public void build() throws IOException { attributes.put("leveloffset", "2"); attributes.put("fragment", "yes"); - Map branchAttributes = context.asciiDoctor().parseAttributes(new URL(String.format(DOCUMENT_ATTRIBUTES_BRANCH_URL, v.getVersionShorter())), attributes); - Map tagAttributes = context.asciiDoctor().parseAttributes(new URL(String.format(DOCUMENT_ATTRIBUTES_TAG_URL, v.getVersion())), attributes); + List attributeSources = source.getAttributeSources(); - attributes.putAll(branchAttributes); - attributes.putAll(tagAttributes); + if (attributeSources != null) { + for (String attributeSource : source.getAttributeSources()) { + URL templateUrl = buildTemplateUrl(source, version, attributeSource); + Map templateAttributes = context.asciiDoctor().parseAttributes(templateUrl, attributes); + attributes.putAll(templateAttributes); + } + } - String releaseNotesUrl = String.format(RELEASE_NOTES_URL, v.getVersionShorter(), v.getVersion().replace(".", "_")); - URL url = new URL(releaseNotesUrl); + URL releaseNotesURL = buildTemplateUrl(source, version, source.getReleaseNotes()); try { - context.asciiDoctor().writeFile(attributes, url, releaseNotesFile.getParentFile(), releaseNotesFile.getName()); - printStep("created", v.getVersion()); + context.asciiDoctor().writeFile(attributes, releaseNotesURL, releaseNotesFile.getParentFile(), releaseNotesFile.getName()); + printStep("created", source.getId() + " " + version.getVersion()); } catch (FileNotFoundException e) { - printStep("notfound", v.getVersion()); + printStep("notfound", source.getId() + " " + version.getVersion()); releaseNotesMissingFile.createNewFile(); } } if (releaseNotesFile.isFile()) { - v.setReleaseNotes("cache/releases/" + v.getVersion() + "/release-notes.html"); + version.setReleaseNotes("cache/releases/" + source.getId() + "/" + version.getVersion() + "/release-notes.html"); } } catch (Exception e) { - printStep("error", v.getVersion() + " (" + e.getClass().getSimpleName() + ")"); + printStep("error", source.getId() + " " + version.getVersion() + " (" + e.getClass().getSimpleName() + ")"); } } } + private URL buildTemplateUrl(ReleasesMetadata.ReleaseSource source, Versions.Version version, String pathTemplate) throws Exception { + Configuration configuration = new Configuration(Configuration.VERSION_2_3_31); + Template template = new Template("template", pathTemplate, configuration); + StringWriter writer = new StringWriter(); + Map attributes = new HashMap<>(); + + attributes.put("version", version); + template.process(attributes, writer); + + String path = writer.toString(); + + return new URL(String.format("https://raw.githubusercontent.com/%s/%s", source.getRepo(), path)); + } } diff --git a/versions/26.0.0.json b/versions/keycloak-client/26.0.0.json similarity index 100% rename from versions/26.0.0.json rename to versions/keycloak-client/26.0.0.json diff --git a/versions/keycloak-client/26.0.1.json b/versions/keycloak-client/26.0.1.json new file mode 100644 index 00000000..c41f4c5a --- /dev/null +++ b/versions/keycloak-client/26.0.1.json @@ -0,0 +1,7 @@ +{ + "date": "2024-10-22", + "version": "26.0.1", + "blogTemplate": 3, + "documentationTemplate": 12, + "downloadTemplate": 24 +} diff --git a/versions/keycloak-client/26.0.2.json b/versions/keycloak-client/26.0.2.json new file mode 100644 index 00000000..7841b21f --- /dev/null +++ b/versions/keycloak-client/26.0.2.json @@ -0,0 +1,7 @@ +{ + "date": "2024-10-31", + "version": "26.0.2", + "blogTemplate": 3, + "documentationTemplate": 12, + "downloadTemplate": 24 +} diff --git a/versions/keycloak-client/26.0.3.json b/versions/keycloak-client/26.0.3.json new file mode 100644 index 00000000..fe8a0d02 --- /dev/null +++ b/versions/keycloak-client/26.0.3.json @@ -0,0 +1,7 @@ +{ + "date": "2024-11-19", + "version": "26.0.3", + "blogTemplate": 3, + "documentationTemplate": 12, + "downloadTemplate": 24 +} diff --git a/versions/21.0.0.json b/versions/keycloak/21.0.0.json similarity index 100% rename from versions/21.0.0.json rename to versions/keycloak/21.0.0.json diff --git a/versions/21.0.1.json b/versions/keycloak/21.0.1.json similarity index 100% rename from versions/21.0.1.json rename to versions/keycloak/21.0.1.json diff --git a/versions/21.0.2.json b/versions/keycloak/21.0.2.json similarity index 100% rename from versions/21.0.2.json rename to versions/keycloak/21.0.2.json diff --git a/versions/21.1.0.json b/versions/keycloak/21.1.0.json similarity index 100% rename from versions/21.1.0.json rename to versions/keycloak/21.1.0.json diff --git a/versions/21.1.1.json b/versions/keycloak/21.1.1.json similarity index 100% rename from versions/21.1.1.json rename to versions/keycloak/21.1.1.json diff --git a/versions/21.1.2.json b/versions/keycloak/21.1.2.json similarity index 100% rename from versions/21.1.2.json rename to versions/keycloak/21.1.2.json diff --git a/versions/22.0.0.json b/versions/keycloak/22.0.0.json similarity index 100% rename from versions/22.0.0.json rename to versions/keycloak/22.0.0.json diff --git a/versions/22.0.1.json b/versions/keycloak/22.0.1.json similarity index 100% rename from versions/22.0.1.json rename to versions/keycloak/22.0.1.json diff --git a/versions/22.0.2.json b/versions/keycloak/22.0.2.json similarity index 100% rename from versions/22.0.2.json rename to versions/keycloak/22.0.2.json diff --git a/versions/22.0.3.json b/versions/keycloak/22.0.3.json similarity index 100% rename from versions/22.0.3.json rename to versions/keycloak/22.0.3.json diff --git a/versions/22.0.4.json b/versions/keycloak/22.0.4.json similarity index 100% rename from versions/22.0.4.json rename to versions/keycloak/22.0.4.json diff --git a/versions/22.0.5.json b/versions/keycloak/22.0.5.json similarity index 100% rename from versions/22.0.5.json rename to versions/keycloak/22.0.5.json diff --git a/versions/23.0.0.json b/versions/keycloak/23.0.0.json similarity index 100% rename from versions/23.0.0.json rename to versions/keycloak/23.0.0.json diff --git a/versions/23.0.1.json b/versions/keycloak/23.0.1.json similarity index 100% rename from versions/23.0.1.json rename to versions/keycloak/23.0.1.json diff --git a/versions/23.0.2.json b/versions/keycloak/23.0.2.json similarity index 100% rename from versions/23.0.2.json rename to versions/keycloak/23.0.2.json diff --git a/versions/23.0.3.json b/versions/keycloak/23.0.3.json similarity index 100% rename from versions/23.0.3.json rename to versions/keycloak/23.0.3.json diff --git a/versions/23.0.4.json b/versions/keycloak/23.0.4.json similarity index 100% rename from versions/23.0.4.json rename to versions/keycloak/23.0.4.json diff --git a/versions/23.0.5.json b/versions/keycloak/23.0.5.json similarity index 100% rename from versions/23.0.5.json rename to versions/keycloak/23.0.5.json diff --git a/versions/23.0.6.json b/versions/keycloak/23.0.6.json similarity index 100% rename from versions/23.0.6.json rename to versions/keycloak/23.0.6.json diff --git a/versions/23.0.7.json b/versions/keycloak/23.0.7.json similarity index 100% rename from versions/23.0.7.json rename to versions/keycloak/23.0.7.json diff --git a/versions/24.0.0.json b/versions/keycloak/24.0.0.json similarity index 100% rename from versions/24.0.0.json rename to versions/keycloak/24.0.0.json diff --git a/versions/24.0.1.json b/versions/keycloak/24.0.1.json similarity index 100% rename from versions/24.0.1.json rename to versions/keycloak/24.0.1.json diff --git a/versions/24.0.2.json b/versions/keycloak/24.0.2.json similarity index 100% rename from versions/24.0.2.json rename to versions/keycloak/24.0.2.json diff --git a/versions/24.0.3.json b/versions/keycloak/24.0.3.json similarity index 100% rename from versions/24.0.3.json rename to versions/keycloak/24.0.3.json diff --git a/versions/24.0.4.json b/versions/keycloak/24.0.4.json similarity index 100% rename from versions/24.0.4.json rename to versions/keycloak/24.0.4.json diff --git a/versions/24.0.5.json b/versions/keycloak/24.0.5.json similarity index 100% rename from versions/24.0.5.json rename to versions/keycloak/24.0.5.json diff --git a/versions/25.0.0.json b/versions/keycloak/25.0.0.json similarity index 100% rename from versions/25.0.0.json rename to versions/keycloak/25.0.0.json diff --git a/versions/25.0.1.json b/versions/keycloak/25.0.1.json similarity index 100% rename from versions/25.0.1.json rename to versions/keycloak/25.0.1.json diff --git a/versions/25.0.2.json b/versions/keycloak/25.0.2.json similarity index 100% rename from versions/25.0.2.json rename to versions/keycloak/25.0.2.json diff --git a/versions/25.0.4.json b/versions/keycloak/25.0.4.json similarity index 100% rename from versions/25.0.4.json rename to versions/keycloak/25.0.4.json diff --git a/versions/25.0.5.json b/versions/keycloak/25.0.5.json similarity index 100% rename from versions/25.0.5.json rename to versions/keycloak/25.0.5.json diff --git a/versions/25.0.6.json b/versions/keycloak/25.0.6.json similarity index 100% rename from versions/25.0.6.json rename to versions/keycloak/25.0.6.json diff --git a/versions/keycloak/26.0.0.json b/versions/keycloak/26.0.0.json new file mode 100644 index 00000000..b164ed05 --- /dev/null +++ b/versions/keycloak/26.0.0.json @@ -0,0 +1,7 @@ +{ + "date": "2024-10-04", + "version": "26.0.0", + "blogTemplate": 3, + "documentationTemplate": 12, + "downloadTemplate": 24 +} diff --git a/versions/26.0.1.json b/versions/keycloak/26.0.1.json similarity index 100% rename from versions/26.0.1.json rename to versions/keycloak/26.0.1.json diff --git a/versions/26.0.2.json b/versions/keycloak/26.0.2.json similarity index 100% rename from versions/26.0.2.json rename to versions/keycloak/26.0.2.json diff --git a/versions/26.0.4.json b/versions/keycloak/26.0.4.json similarity index 100% rename from versions/26.0.4.json rename to versions/keycloak/26.0.4.json diff --git a/versions/26.0.5.json b/versions/keycloak/26.0.5.json similarity index 100% rename from versions/26.0.5.json rename to versions/keycloak/26.0.5.json diff --git a/versions/26.0.6.json b/versions/keycloak/26.0.6.json similarity index 100% rename from versions/26.0.6.json rename to versions/keycloak/26.0.6.json diff --git a/versions/26.0.7.json b/versions/keycloak/26.0.7.json similarity index 100% rename from versions/26.0.7.json rename to versions/keycloak/26.0.7.json