From 35152efa7bab73c186373bd2b8fd34854be41247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Furkan=20T=C3=BCrkal?= Date: Sun, 11 Aug 2024 01:22:39 +0300 Subject: [PATCH] keycloak: bitnami: upgrade to 25 and fix data path (#26092) Dynamically parse major version to pass `bitnami/compat` pipeline and create a missing `data` dir. Signed-off-by: Dentrax --- keycloak.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/keycloak.yaml b/keycloak.yaml index 171aa65b5e0..ef2c853febf 100644 --- a/keycloak.yaml +++ b/keycloak.yaml @@ -1,7 +1,7 @@ package: name: keycloak version: 25.0.2 - epoch: 2 + epoch: 3 description: Open Source Identity and Access Management For Modern Applications and Services copyright: - license: Apache-2.0 @@ -10,6 +10,15 @@ package: - bash # Keycloak helper scripts require bash, aren't compatible with busybox. - openjdk-17-default-jvm +# Create a new major-version variable that contains only the major version +# to use in the bitnami/compat pipeline to find out the correct folder for the image. +# e.g. 25.0.2 will create a new var major-version=25 +var-transforms: + - from: ${{package.version}} + match: ^(\d+).* + replace: $1 + to: major-version + environment: contents: packages: @@ -49,6 +58,9 @@ pipeline: unzip -d ${{targets.destdir}}/usr/share/java quarkus/dist/target/keycloak-*.zip cp -avR ${{targets.destdir}}/usr/share/java/keycloak-* ${{targets.destdir}}/usr/share/java/keycloak + # Create an empty data directory for keycloak. Required by the UI to store some data. + mkdir -p ${{targets.destdir}}/usr/share/java/keycloak/data + mkdir -p ${{targets.destdir}}/usr/bin for i in kc.sh kcadm.sh kcreg.sh; do ln -sf /usr/share/java/keycloak/bin/$i ${{targets.destdir}}/usr/bin/$i @@ -67,6 +79,7 @@ subpackages: description: "compat package with bitnami/keycloak image" dependencies: runtime: + - coreutils # Keycloak Helm Chart scripts require coreutils, aren't compatible with busybox. (i.e., `cp` with `--preserve` option) - krb5 - libaio - procps @@ -79,7 +92,7 @@ subpackages: - uses: bitnami/compat with: image: keycloak - version-path: 24/debian-12 + version-path: ${{vars.major-version}}/debian-12 - runs: | mkdir -p ${{targets.contextdir}}/bitnami/keycloak mkdir -p ${{targets.contextdir}}/opt/bitnami/keycloak