Commit 07e38605 authored by Matthias Piepkorn's avatar Matthias Piepkorn Committed by Doccrazy

Update to Keycloak 5.0.0

parent 06c16913
...@@ -13,20 +13,20 @@ services: ...@@ -13,20 +13,20 @@ services:
- docker - docker
env: env:
- KEYCLOAK_VERSION=4.8.3.Final - KEYCLOAK_VERSION=5.0.0
before_install: before_install:
- if [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then docker pull jboss/keycloak:$KEYCLOAK_VERSION; fi - if [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then docker pull quay.io/keycloak/keycloak:$KEYCLOAK_VERSION; fi
script: script:
- if [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then - if [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then
mvn test package -B && mvn test package -B &&
mkdir target/docker && mkdir target/docker &&
cp target/*.jar target/docker/keycloak-protocol-cas.jar && cp target/*.jar target/docker/keycloak-protocol-cas.jar &&
echo "FROM jboss/keycloak:$KEYCLOAK_VERSION" > target/docker/Dockerfile && echo "FROM quay.io/keycloak/keycloak:$KEYCLOAK_VERSION" > target/docker/Dockerfile &&
echo "ADD keycloak-protocol-cas.jar /opt/jboss/keycloak/standalone/deployments/" >> target/docker/Dockerfile && echo "ADD keycloak-protocol-cas.jar /opt/jboss/keycloak/standalone/deployments/" >> target/docker/Dockerfile &&
cd target/docker && docker build -t doccrazy/keycloak-cas . && cd ../.. && cd target/docker && docker build -t doccrazy/keycloak-cas . && cd ../.. &&
docker run -d -p 127.0.0.1:8080:8080 --name keycloak -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin doccrazy/keycloak-cas && sleep 30 && docker run -d -p 127.0.0.1:8080:8080 --name keycloak -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin doccrazy/keycloak-cas && sleep 60 &&
docker logs keycloak && docker logs keycloak &&
docker exec -t keycloak /opt/jboss/keycloak/bin/kcadm.sh config credentials --server http://localhost:8080/auth --realm master --user admin --password admin && docker exec -t keycloak /opt/jboss/keycloak/bin/kcadm.sh config credentials --server http://localhost:8080/auth --realm master --user admin --password admin &&
docker exec -t keycloak /opt/jboss/keycloak/bin/kcadm.sh create clients -r master -s clientId=test -s protocol=cas -s enabled=true -s publicClient=true -s 'redirectUris=["http://localhost/*"]' -s baseUrl=http://localhost -s adminUrl=http://localhost && docker exec -t keycloak /opt/jboss/keycloak/bin/kcadm.sh create clients -r master -s clientId=test -s protocol=cas -s enabled=true -s publicClient=true -s 'redirectUris=["http://localhost/*"]' -s baseUrl=http://localhost -s adminUrl=http://localhost &&
......
...@@ -22,14 +22,14 @@ ...@@ -22,14 +22,14 @@
<groupId>org.keycloak</groupId> <groupId>org.keycloak</groupId>
<artifactId>keycloak-protocol-cas</artifactId> <artifactId>keycloak-protocol-cas</artifactId>
<version>4.8.3</version> <version>5.0.0</version>
<name>Keycloak CAS Protocol</name> <name>Keycloak CAS Protocol</name>
<description /> <description />
<properties> <properties>
<keycloak.version>${project.version}.Final</keycloak.version> <keycloak.version>${project.version}</keycloak.version>
<jboss.logging.version>3.3.0.Final</jboss.logging.version> <jboss.logging.version>3.3.2.Final</jboss.logging.version>
<jboss.logging.tools.version>2.0.1.Final</jboss.logging.tools.version> <jboss.logging.tools.version>2.1.0.Final</jboss.logging.tools.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
...@@ -124,6 +124,7 @@ ...@@ -124,6 +124,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>3.1.1</version>
<configuration> <configuration>
<archive> <archive>
<manifestEntries> <manifestEntries>
......
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
set -e set -e
function docker_tag_exists() { function docker_tag_exists() {
TOKEN=$(curl --silent -f "https://auth.docker.io/token?service=registry.docker.io&scope=repository:$1:pull" | sed 's/.*"token":"\([^"]*\)".*/\1/') REGISTRY_URL="https://quay.io/v2/$1/manifests/$2"
REGISTRY_URL="https://registry-1.docker.io/v2/$1/manifests/$2" curl -fsSLI "$REGISTRY_URL" > /dev/null
curl -fsSLI -H "Authorization: Bearer $TOKEN" "$REGISTRY_URL" > /dev/null
} }
setup_git() { setup_git() {
...@@ -18,8 +17,7 @@ pull_request() { ...@@ -18,8 +17,7 @@ pull_request() {
} }
KEYCLOAK_VERSION=$(mvn versions:display-property-updates -DincludeProperties=keycloak.version | grep "keycloak.version" | sed -n "s/.*->\s*\(.*\)\.Final$/\1/p") KEYCLOAK_VERSION=$(mvn versions:display-property-updates -DincludeProperties=keycloak.version | grep "keycloak.version" | sed -nr "s/.*->\s*([0-9]+\.[0-9]+\.[0-9])$/\1/p")
KEYCLOAK_VERSION_FULL=$KEYCLOAK_VERSION.Final
if [ -z "$KEYCLOAK_VERSION" ]; then if [ -z "$KEYCLOAK_VERSION" ]; then
echo "No Keycloak update found." echo "No Keycloak update found."
exit exit
...@@ -32,22 +30,22 @@ if git ls-remote -q --exit-code origin $BRANCH; then ...@@ -32,22 +30,22 @@ if git ls-remote -q --exit-code origin $BRANCH; then
exit exit
fi fi
if ! docker_tag_exists jboss/keycloak $KEYCLOAK_VERSION_FULL; then if ! docker_tag_exists keycloak/keycloak $KEYCLOAK_VERSION; then
echo "Docker image for Keycloak $KEYCLOAK_VERSION_FULL not found, not updating." echo "Docker image for Keycloak $KEYCLOAK_VERSION not found, not updating."
exit exit
fi fi
echo "Found updated docker image, proceeding" echo "Found updated docker image, proceeding"
mvn versions:set -DnewVersion=$KEYCLOAK_VERSION -DgenerateBackupPoms=false mvn versions:set -DnewVersion=$KEYCLOAK_VERSION -DgenerateBackupPoms=false
sed -i "s/KEYCLOAK_VERSION=.*/KEYCLOAK_VERSION=$KEYCLOAK_VERSION_FULL/" .travis.yml sed -i "s/KEYCLOAK_VERSION=.*/KEYCLOAK_VERSION=$KEYCLOAK_VERSION/" .travis.yml
setup_git setup_git
git checkout -b $BRANCH git checkout -b $BRANCH
git add pom.xml .travis.yml git add pom.xml .travis.yml
git commit -m "Update to Keycloak $KEYCLOAK_VERSION_FULL" git commit -m "Update to Keycloak $KEYCLOAK_VERSION"
git push --quiet --set-upstream origin-auth $BRANCH git push --quiet --set-upstream origin-auth $BRANCH
PR_TITLE="Update to Keycloak $KEYCLOAK_VERSION_FULL" PR_TITLE="Update to Keycloak $KEYCLOAK_VERSION"
PR_BODY="Updates Keycloak dependency, CI test image and project version for Keycloak release $KEYCLOAK_VERSION_FULL\\n\\n*(automated pull request after upstream release)*" PR_BODY="Updates Keycloak dependency, CI test image and project version for Keycloak release $KEYCLOAK_VERSION\\n\\n*(automated pull request after upstream release)*"
pull_request $BRANCH "$PR_TITLE" "$PR_BODY" pull_request $BRANCH "$PR_TITLE" "$PR_BODY"
echo "Created pull request '$PR_TITLE'" echo "Created pull request '$PR_TITLE'"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment