2023-07-18 15:58:26 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-07-27 16:29:59 +02:00
|
|
|
VERSION=1.4.99-22.0.0
|
2023-07-18 15:58:26 +02:00
|
|
|
APP=keycloak-radius-plugin
|
|
|
|
DEPOT=https://github.com/vzakharchenko/keycloak-radius-plugin.git
|
|
|
|
GIT_VERSION=v${VERSION}
|
2023-07-27 16:29:59 +02:00
|
|
|
GIT_VERSION=last
|
2023-07-18 15:58:26 +02:00
|
|
|
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
|
|
|
|
DEBIAN_VERSION_CODENAME=bookworm
|
|
|
|
IMAGE_SIZE=12
|
|
|
|
PACKAGE_DEPENDENCY="default-jdk maven"
|
|
|
|
|
2023-07-27 16:29:59 +02:00
|
|
|
shopt -s extglob
|
|
|
|
|
2023-07-18 15:58:26 +02:00
|
|
|
main(){
|
|
|
|
base_package_upgrade
|
|
|
|
install_package_dependency
|
2023-07-27 16:29:59 +02:00
|
|
|
#get_git_source
|
|
|
|
[ -e /tmp/${APP} ] && rm -fr /tmp/${APP}
|
|
|
|
git clone https://github.com/elkman/keycloak-radius-plugin.git /tmp/${APP}
|
|
|
|
cd /tmp/${APP}
|
|
|
|
git checkout remotes/origin/feature/upgrade-to-kc22.0.1
|
2023-07-18 15:58:26 +02:00
|
|
|
build
|
|
|
|
makedeb
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd /tmp/${APP}/keycloak-plugins
|
2023-07-27 16:29:59 +02:00
|
|
|
KEYCLOAK_VERSION=22.0.1
|
|
|
|
sed -i "s/<keycloak.version>[0-9]\+\(\.[0-9]\+\)*<\/keycloak.version>/<keycloak.version>${KEYCLOAK_VERSION}<\/keycloak.version>/g" pom.xml
|
2023-07-18 15:58:26 +02:00
|
|
|
mvn clean install -DskipTestsuite -DskipExamples -DskipTests
|
|
|
|
}
|
|
|
|
|
|
|
|
makedeb(){
|
|
|
|
PATH_DEB=/tmp/src/rootfs
|
|
|
|
|
|
|
|
mkdir -p ${PATH_DEB}/usr/lib/keycloak/providers
|
|
|
|
|
2023-07-27 16:29:59 +02:00
|
|
|
|
|
|
|
cp /tmp/${APP}/keycloak-plugins/chillispot-radius-plugin/target/chillispot-radius-plugin-*[[:digit:]].*[[:digit:]].*[[:digit:]]+(-SNAPSHOT).jar ${PATH_DEB}/usr/lib/keycloak/providers
|
|
|
|
cp /tmp/${APP}/keycloak-plugins/cisco-radius-plugin/target/cisco-radius-plugin-*[[:digit:]].*[[:digit:]].*[[:digit:]]+(-SNAPSHOT).jar ${PATH_DEB}/usr/lib/keycloak/providers
|
|
|
|
cp /tmp/${APP}/keycloak-plugins/proxy-radius-plugin/target/proxy-radius-plugin-*[[:digit:]].*[[:digit:]].*[[:digit:]]+(-SNAPSHOT).jar ${PATH_DEB}/usr/lib/keycloak/providers
|
|
|
|
cp /tmp/${APP}/keycloak-plugins/radius-disconnect-plugin/target/radius-disconnect-plugin-*[[:digit:]].*[[:digit:]].*[[:digit:]]+(-SNAPSHOT).jar ${PATH_DEB}/usr/lib/keycloak/providers
|
|
|
|
cp /tmp/${APP}/keycloak-plugins/radius-plugin/target/radius-plugin-*[[:digit:]].*[[:digit:]].*[[:digit:]]+(-SNAPSHOT).jar ${PATH_DEB}/usr/lib/keycloak/providers
|
|
|
|
cp /tmp/${APP}/keycloak-plugins/rad-sec-plugin/target/rad-sec-plugin-*[[:digit:]].*[[:digit:]].*[[:digit:]]+(-SNAPSHOT).jar ${PATH_DEB}/usr/lib/keycloak/providers
|
|
|
|
cp /tmp/${APP}/keycloak-plugins/mikrotik-radius-plugin/target/mikrotik-radius-plugin-*[[:digit:]].*[[:digit:]].*[[:digit:]]+(-SNAPSHOT).jar ${PATH_DEB}/usr/lib/keycloak/providers
|
|
|
|
cp /tmp/${APP}/keycloak-plugins/radius-theme/target/radius-theme-*[[:digit:]].*[[:digit:]].*[[:digit:]]+(-SNAPSHOT).zip ${PATH_DEB}/usr/lib/keycloak/providers
|
2023-07-18 15:58:26 +02:00
|
|
|
|
|
|
|
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
|
|
|
|
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
|
|
|
|
}
|