52 lines
2.4 KiB
Bash
Executable File
52 lines
2.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
VERSION=1.4.99-22.0.0
|
|
APP=keycloak-radius-plugin
|
|
DEPOT=https://github.com/vzakharchenko/keycloak-radius-plugin.git
|
|
GIT_VERSION=v${VERSION}
|
|
GIT_VERSION=last
|
|
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
|
|
DEBIAN_VERSION_CODENAME=bookworm
|
|
IMAGE_SIZE=12
|
|
PACKAGE_DEPENDENCY="default-jdk maven"
|
|
|
|
shopt -s extglob
|
|
|
|
main(){
|
|
base_package_upgrade
|
|
install_package_dependency
|
|
#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
|
|
build
|
|
makedeb
|
|
}
|
|
|
|
build() {
|
|
cd /tmp/${APP}/keycloak-plugins
|
|
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
|
|
mvn clean install -DskipTestsuite -DskipExamples -DskipTests
|
|
}
|
|
|
|
makedeb(){
|
|
PATH_DEB=/tmp/src/rootfs
|
|
|
|
mkdir -p ${PATH_DEB}/usr/lib/keycloak/providers
|
|
|
|
|
|
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
|
|
|
|
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
|
|
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
|
|
}
|