Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize add-version.sh script to allow versioning other repos #563

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions add-version-client.sh

This file was deleted.

12 changes: 7 additions & 5 deletions add-version.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/bin/bash -e

VERSION=$1
ID=${2:-'keycloak'}

if [ "$VERSION" == "" ]; then
echo "usage: add-version.sh VERSION"
echo "usage: add-version.sh VERSION [ID]"
exit 1
fi

Expand All @@ -12,18 +14,18 @@ DATE=`date +%F`
if [[ "$VERSION" == *".0" ]]; then
TEMPLATE="version-template.json"
else
TEMPLATE="versions/keycloak/${VERSION%.*}.0.json"
TEMPLATE="versions/$ID/${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/$VERSION_NAME.json
cat $TEMPLATE | sed "s/\"version\":.*/\"version\": \"$VERSION\",/" | sed 's/"date": ".*"/"date": "DATE"/' | sed "s/DATE/$DATE/" > versions/$ID/$VERSION_NAME.json

CURRENT=`cat pom.xml | grep '<version.keycloak>' | cut -d '>' -f 2 | cut -d '<' -f 1`
CURRENT=`cat pom.xml | grep "<version.$ID>" | cut -d '>' -f 2 | cut -d '<' -f 1`
LATEST=`echo -e "$CURRENT\n$VERSION" | sort -V -r | head -n 1`

mvn versions:set-property -Dproperty=version.keycloak -DnewVersion=$LATEST -DgenerateBackupPoms=false
mvn versions:set-property -Dproperty=version.$ID -DnewVersion=$LATEST -DgenerateBackupPoms=false
mvn install
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<version.commons-compress>1.26.0</version.commons-compress>

<version.keycloak>26.1.1</version.keycloak>
<version.keycloak.client>26.0.4</version.keycloak.client>
<version.keycloak-client>26.0.4</version.keycloak-client>
<version.keycloak-nodejs-connect>26.1.1</version.keycloak-nodejs-connect>

<version.frontend-maven-plugin>1.12.1</version.frontend-maven-plugin>
Expand Down Expand Up @@ -249,7 +249,7 @@
<artifactItem>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-client-guides</artifactId>
<version>${version.keycloak.client}</version>
<version>${version.keycloak-client}</version>
<classifier>asciidoc</classifier>
<type>zip</type>
<overWrite>true</overWrite>
Expand Down