From b940f47b482e8f002cf6b15a5784bf6a94c58cd2 Mon Sep 17 00:00:00 2001 From: mposolda Date: Wed, 4 Dec 2024 19:34:53 +0100 Subject: [PATCH 1/2] Updating set-version.sh and adding set-server-version.sh closes #639 Signed-off-by: mposolda --- set-server-version.sh | 37 +++++++++++++++++++++++++++++++++++++ set-version.sh | 35 +++-------------------------------- 2 files changed, 40 insertions(+), 32 deletions(-) create mode 100755 set-server-version.sh diff --git a/set-server-version.sh b/set-server-version.sh new file mode 100755 index 000000000..805d2b9c2 --- /dev/null +++ b/set-server-version.sh @@ -0,0 +1,37 @@ +#!/bin/bash -e + +NEW_VERSION=$1 + +function updateNpmDep() { + FILE="$1" + PACKAGE="$2" + + sed -i 's|"'"$PACKAGE"'": "[^"]*"|"'"$PACKAGE"'": "'"$NEW_VERSION"'"|g' $FILE +} + +mvn versions:set-property -Dproperty=version.keycloak -DnewVersion=$NEW_VERSION -DgenerateBackupPoms=false + +sed -i 's/ image:\(.*\):.*/ image:\1:'"$NEW_VERSION"'/g' kubernetes/keycloak.yaml +sed -i 's/ version: .*/ version: '"$NEW_VERSION"'/g' openshift/keycloak.yaml +sed -i 's/ image:\(.*\):.*/ image:\1:'"$NEW_VERSION"'/g' openshift/keycloak.yaml + +if [[ $NEW_VERSION == "999.0.0-SNAPSHOT" ]]; then + # Use the nightly versions of adapters + NPM_ADMIN_CLIENT="https://github.com/keycloak/keycloak/releases/download/nightly/keycloak-admin-client-999.0.0-SNAPSHOT.tgz" + NPM_NODE_ADAPTER="https://github.com/keycloak/keycloak-nodejs-connect/releases/download/nightly/keycloak-nodejs-connect.tgz"; +else + NPM_ADMIN_CLIENT=$NEW_VERSION + NPM_NODE_ADAPTER=$NEW_VERSION +fi + +# JS quickstart +updateNpmDep js/spa/package.json "@keycloak/keycloak-admin-client" +updateNpmDep js/spa/package.json "keycloak-js" + +# NodeJS quickstart +updateNpmDep nodejs/resource-server/package.json "@keycloak/keycloak-admin-client" +updateNpmDep nodejs/resource-server/package.json "keycloak-connect" + +echo "New Mvn Version: $NEW_VERSION" >&2 +echo "Used NPM dependency of keycloak-admin-client: $NPM_ADMIN_CLIENT" >&2 +echo "Used NPM dependency of node-adapter: $NPM_NODE_ADAPTER" >&2 diff --git a/set-version.sh b/set-version.sh index f63d465a7..319de1b49 100755 --- a/set-version.sh +++ b/set-version.sh @@ -1,36 +1,7 @@ #!/bin/bash -e -NEW_VERSION=$1 - -function updateNpmDep() { - FILE="$1" - PACKAGE="$2" - - sed -i 's|"'"$PACKAGE"'": "[^"]*"|"'"$PACKAGE"'": "'"$NEW_VERSION"'"|g' $FILE -} - -mvn versions:set -Dversion.keycloak=$NEW_VERSION -DnewVersion=$NEW_VERSION -DgenerateBackupPoms=false -DgroupId=org.keycloak* -DartifactId=* +# Sets new version of the project in all pom.xml files -sed -i 's/\$\$VERSION\$\$/'"$NEW_VERSION"'/g' kubernetes/keycloak.yaml -sed -i 's/\$\$VERSION\$\$/'"$NEW_VERSION"'/g' openshift/keycloak.yaml - -if [[ $NEW_VERSION == "999.0.0-SNAPSHOT" ]]; then - # Use the nightly versions of adapters - NPM_ADMIN_CLIENT="https://github.com/keycloak/keycloak/releases/download/nightly/keycloak-admin-client-999.0.0-SNAPSHOT.tgz" - NPM_NODE_ADAPTER="https://github.com/keycloak/keycloak-nodejs-connect/releases/download/nightly/keycloak-nodejs-connect.tgz"; -else - NPM_ADMIN_CLIENT=$NEW_VERSION - NPM_NODE_ADAPTER=$NEW_VERSION -fi - -# JS quickstart -updateNpmDep js/spa/package.json "@keycloak/keycloak-admin-client" -updateNpmDep js/spa/package.json "keycloak-js" - -# NodeJS quickstart -updateNpmDep nodejs/resource-server/package.json "@keycloak/keycloak-admin-client" -updateNpmDep nodejs/resource-server/package.json "keycloak-connect" +NEW_VERSION=$1 -echo "New Mvn Version: $NEW_VERSION" >&2 -echo "Used NPM dependency of keycloak-admin-client: $NPM_ADMIN_CLIENT" >&2 -echo "Used NPM dependency of node-adapter: $NPM_NODE_ADAPTER" >&2 +mvn versions:set -DnewVersion=$NEW_VERSION -DgenerateBackupPoms=false -DgroupId=org.keycloak* -DartifactId=* From bcc7b748a5523dc5c098a4c3ded9a28cc434fe8f Mon Sep 17 00:00:00 2001 From: mposolda Date: Wed, 4 Dec 2024 19:42:59 +0100 Subject: [PATCH 2/2] Updated server version to 26.0.7 Signed-off-by: mposolda --- js/spa/package.json | 4 ++-- kubernetes/keycloak.yaml | 2 +- nodejs/resource-server/package.json | 4 ++-- openshift/keycloak.yaml | 4 ++-- pom.xml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/js/spa/package.json b/js/spa/package.json index a7f4e7297..e4f9e6806 100644 --- a/js/spa/package.json +++ b/js/spa/package.json @@ -8,9 +8,9 @@ "delete-realm": "node scripts/delete-realm.js" }, "dependencies": { - "@keycloak/keycloak-admin-client": "https://github.com/keycloak/keycloak/releases/download/nightly/keycloak-admin-client-999.0.0-SNAPSHOT.tgz", + "@keycloak/keycloak-admin-client": "26.0.7", "express": "^4.18.2", - "keycloak-js": "https://github.com/keycloak/keycloak/releases/download/nightly/keycloak-js-999.0.0-SNAPSHOT.tgz" + "keycloak-js": "26.0.7" }, "devDependencies": { "@playwright/test": "^1.33.0" diff --git a/kubernetes/keycloak.yaml b/kubernetes/keycloak.yaml index 73d1452d7..55abd7245 100644 --- a/kubernetes/keycloak.yaml +++ b/kubernetes/keycloak.yaml @@ -31,7 +31,7 @@ spec: spec: containers: - name: keycloak - image: quay.io/keycloak/keycloak:$$VERSION$$ + image: quay.io/keycloak/keycloak:26.0.7 args: ["start-dev"] env: - name: KEYCLOAK_ADMIN diff --git a/nodejs/resource-server/package.json b/nodejs/resource-server/package.json index 1ae3a5fbb..f23ecbfde 100644 --- a/nodejs/resource-server/package.json +++ b/nodejs/resource-server/package.json @@ -8,9 +8,9 @@ "delete-realm": "node scripts/delete-realm.js" }, "dependencies": { - "@keycloak/keycloak-admin-client": "https://github.com/keycloak/keycloak/releases/download/nightly/keycloak-admin-client-999.0.0-SNAPSHOT.tgz", + "@keycloak/keycloak-admin-client": "26.0.7", "express": "^4.18.2", - "keycloak-connect": "https://github.com/keycloak/keycloak-nodejs-connect/releases/download/nightly/keycloak-nodejs-connect.tgz" + "keycloak-connect": "26.0.7" }, "devDependencies": { "keycloak-request-token": "^0.1.0" diff --git a/openshift/keycloak.yaml b/openshift/keycloak.yaml index fe4c05d51..4dc1a091d 100644 --- a/openshift/keycloak.yaml +++ b/openshift/keycloak.yaml @@ -7,7 +7,7 @@ metadata: iconClass: icon-sso openshift.io/display-name: Keycloak tags: keycloak - version: $$VERSION$$ + version: 26.0.7 objects: - apiVersion: v1 kind: Service @@ -65,7 +65,7 @@ objects: value: '${KEYCLOAK_ADMIN_PASSWORD}' - name: KC_PROXY value: 'edge' - image: quay.io/keycloak/keycloak:$$VERSION$$ + image: quay.io/keycloak/keycloak:26.0.7 livenessProbe: failureThreshold: 100 httpGet: diff --git a/pom.xml b/pom.xml index 1a949a0af..a856057b0 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ - 26.0.6 + 26.0.7 26.0.3 1.0.2.Final