diff --git a/.dependabot/config.yml b/.dependabot/config.yml new file mode 100644 index 0000000..84af61a --- /dev/null +++ b/.dependabot/config.yml @@ -0,0 +1,12 @@ +version: 1 +update_configs: + - package_manager: 'java:gradle' + directory: '/' + update_schedule: 'daily' + automerged_updates: + - match: + dependency_type: "development" + update_type: "all" + - match: + dependency_type: "production" + update_type: "semver:minor" diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..bd35fa9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + +[*] + +# Change these settings to your own preference +indent_style = space +indent_size = 2 + +# We recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[Makefile] +indent_style = tab diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..6a46a23 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,3 @@ +* @Leadformance/cuir-cuir-moustache +build.gradle @Leadformance/cuir-cuir-moustache @Leadformance/dependabot-approvers +gradle.properties @Leadformance/cuir-cuir-moustache @Leadformance/dependabot-approvers diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml new file mode 100644 index 0000000..6d1deaa --- /dev/null +++ b/.github/workflows/auto-approve.yml @@ -0,0 +1,11 @@ +name: Dependabot PR +on: pull_request + +jobs: + auto-approve: + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' + steps: + - uses: hmarr/auto-approve-action@v2.0.0 + with: + github-token: "${{ secrets.CI_GH_TOKEN }}" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d262b1b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,66 @@ +name: CI +on: + push: + branches: + - master + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[skip ci]')" + steps: + - uses: actions/checkout@v1 + + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: 12.x + registry-url: https://solocal.jfrog.io/solocal/api/npm/npm/ + always-auth: true + scope: '@bridge' + + - uses: actions/cache@v2 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Build + run: | + ./gradlew build + + - name: Test + run: | + mkdir build/docker + cd build/docker + cp ../libs/*.jar ./keycloak-protocol-cas.jar + echo "FROM quay.io/keycloak/keycloak:7" > Dockerfile + echo "ADD keycloak-protocol-cas.jar /opt/jboss/keycloak/standalone/deployments/" >> Dockerfile + 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 60 + 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 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 get serverinfo -r master --fields "providers(login-protocol(providers(cas)))" | grep cas + integrationTest/suite.sh + + - name: 'Release' + run: | + mkdir -p .github-assets/ + cp build/libs/keycloak-plugin-auth-flow-recaptcha-*.jar .github-assets/keycloak-plugin-auth-flow-recaptcha.jar + npx -p @bridge/semantic-release-config gh-actions-bridge-semantic-release + env: + SEMVER_RELEASE_TYPE: KEYCLOAK_PLUGIN + ACTION_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.CI_GH_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index 32e898b..7e5b25f 100644 --- a/.gitignore +++ b/.gitignore @@ -42,10 +42,7 @@ nbproject ###################### *.log -# Maven # +# Gradle # ######### -target - -# Maven shade -############# -*dependency-reduced-pom.xml +build/ +.gradle/ diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..9ae06cf --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +@bridge:registry=https://solocal.jfrog.io/solocal/api/npm/npm/ +always-auth = true diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000..071548f --- /dev/null +++ b/.releaserc @@ -0,0 +1,3 @@ +{ + "extends": "@bridge/semantic-release-config" +} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8d758cd..0000000 --- a/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -language: java - -cache: - directories: - - "$HOME/.m2" - -jdk: -- openjdk11 - -sudo: required - -services: - - docker - -env: - - KEYCLOAK_VERSION=7.0.0 - -before_install: - - if [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then docker pull quay.io/keycloak/keycloak:$KEYCLOAK_VERSION; fi - -script: - - if [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then - mvn test package -B && - mkdir target/docker && - cp target/*.jar target/docker/keycloak-protocol-cas.jar && - 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 && - 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 60 && - 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 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 get serverinfo -r master --fields "providers(login-protocol(providers(cas)))" | grep cas && - integrationTest/suite.sh - ; fi - - if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then ./update.sh; fi - -before_deploy: - - "mvn -DskipTests package" - - export RELEASE_JAR=$(ls target/keycloak-protocol-cas-*.jar) - -deploy: - provider: releases - api_key: - secure: BPcU12jQ4qs1xAq+Y+6bax+g1AdLatg5E645ISr/NLaKDuWNZxzpMLPf/w9+ngvV5ap5qTz8neoeEbVCLncaIT8wBqlaZnaSnFvVS1huUnwqbh8DzzC6Fmh8DoREpoGo/LV+He1N76bd/lpu0f8VoEqZDtgNYyPAn3xNif+tng8Xa1yh55PqaxB5XlXrArouKCv4jPf+AqzQUMr40Xgn/aQxra6H8PZiEJnxXtweC+UyMNGs5VZkm6nOUW/cpSBppEl6BxyLzJrM2b2pAXQSb85f2EBAIwN38PipwSdckC/3AIhI5Skrx9fEeiuW/YzsZKl7XTohn45fzirc6EzsGBvLucsIda+qMp6Zf4sd8uM0XgiQ1NJyOxWFVFyg3JP00OmJW4BgumfZTL4lzcDUVhn5DubgqZZM3sqvoz75MUSBYewTo3hLBlqxjVA8qe8S738mlNVcpDjwAuAM7/2UP+hcypnjKttQBFt965+yfxjSs3B+KLRQLp7UTmQ+fTcEr72AenQFoXuVpO0k6ghKYomNLLFOzlLk2JCWtsVirjWzJQTZKP5m23jf4qbfyDM3HDenL+N8l3ZOups9gtGpioxkUGKz2IPHrz7XTwh10OpZi32jOPS2BfFOXUQMNVlZAfbIAwXnbo2DWC0AB2Fz//bJbjF9TnOGTUIODos6joo= - file: "${RELEASE_JAR}" - skip_cleanup: true - on: - tags: true - repo: Doccrazy/keycloak-protocol-cas diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..0119085 --- /dev/null +++ b/build.gradle @@ -0,0 +1,46 @@ +repositories { + jcenter() +} + +apply plugin: 'idea' +apply plugin: 'java' +apply plugin: 'jacoco' + +group 'corg.keycloak' +version '7.0.0' +description 'Keycloak CAS Protocol' + +sourceCompatibility = 1.8 + +configurations { + testCompile.extendsFrom compileOnly +} + +dependencies { + //keycloak + compileOnly "org.jboss.logging:jboss-logging:${project.property('jboss-logging-version')}" + compileOnly "org.jboss.logging:jboss-logging-annotations:${project.property('jboss.logging.tools.version')}" + compileOnly "org.jboss.logging:jboss-logging-processor:${project.property('jboss.logging.tools.version')}" + compileOnly "org.keycloak:keycloak-core:${project.property('keycloak-version')}" + compileOnly "org.keycloak:keycloak-saml-core:${project.property('keycloak-version')}" + compileOnly "org.keycloak:keycloak-services:${project.property('keycloak-version')}" + compileOnly "org.keycloak:keycloak-server-spi:${project.property('keycloak-version')}" + compileOnly "org.keycloak:keycloak-server-spi-private:${project.property('keycloak-version')}" + + // Use JUnit test framework + testCompile 'junit:junit:4.13' + testCompile 'org.xmlunit:xmlunit-core:2.3.0' + testCompile 'com.jayway.jsonpath:json-path:2.2.0' +} + +compileJava { + options.compilerArgs << '-AgeneratedTranslationFilesPath=dist/generated-translation-files' +} + +jar { + manifest { + attributes( + "Dependencies": "javax.xml.bind.api,org.keycloak.keycloak-core,org.keycloak.keycloak-server-spi,org.keycloak.keycloak-server-spi-private,org.keycloak.keycloak-services,org.keycloak.keycloak-saml-core,org.keycloak.keycloak-saml-core-public", + ) + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..ae263bc --- /dev/null +++ b/gradle.properties @@ -0,0 +1,4 @@ +# 10.0.2 +keycloak-version=7.0.0 +jboss-logging-version=3.4.1.Final +jboss.logging.tools.version=2.1.0.Final diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..f3d88b1 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..1b16c34 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..2fe81a7 --- /dev/null +++ b/gradlew @@ -0,0 +1,183 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..9618d8d --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,100 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/pom.xml b/pom.xml deleted file mode 100644 index f130a58..0000000 --- a/pom.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - 4.0.0 - - org.keycloak - keycloak-protocol-cas - 7.0.0 - Keycloak CAS Protocol - - - - ${project.version} - 3.3.2.Final - 2.1.0.Final - 4.12 - - UTF-8 - 1.8 - 1.8 - - - - - org.keycloak - keycloak-core - ${keycloak.version} - provided - - - org.keycloak - keycloak-server-spi - ${keycloak.version} - provided - - - org.keycloak - keycloak-server-spi-private - ${keycloak.version} - provided - - - - org.jboss.logging - jboss-logging - ${jboss.logging.version} - provided - - - org.jboss.logging - jboss-logging-annotations - ${jboss.logging.tools.version} - provided - - - org.jboss.logging - jboss-logging-processor - ${jboss.logging.tools.version} - provided - true - - - org.keycloak - keycloak-services - ${keycloak.version} - provided - - - org.keycloak - keycloak-saml-core - ${keycloak.version} - provided - - - junit - junit - ${junit.version} - test - - - org.xmlunit - xmlunit-core - 2.3.0 - test - - - com.jayway.jsonpath - json-path - 2.2.0 - test - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - ${maven.compiler.source} - ${maven.compiler.target} - - -AgeneratedTranslationFilesPath=${project.build.directory}/generated-translation-files - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.1.1 - - - - javax.xml.bind.api,org.keycloak.keycloak-core,org.keycloak.keycloak-server-spi,org.keycloak.keycloak-server-spi-private,org.keycloak.keycloak-services,org.keycloak.keycloak-saml-core,org.keycloak.keycloak-saml-core-public - - - - - - - diff --git a/update.sh b/update.sh deleted file mode 100755 index 29da39d..0000000 --- a/update.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -set -e - -function docker_tag_exists() { - REGISTRY_URL="https://quay.io/v2/$1/manifests/$2" - curl -fsSLI "$REGISTRY_URL" > /dev/null -} - -setup_git() { - git config --global user.email "updater@travis-ci.org" - git config --global user.name "Updater Bot" - git remote add origin-auth https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git > /dev/null 2>&1 -} - -pull_request() { - curl -fsSL -H "Authorization: token ${GH_TOKEN}" -X POST -d "{\"head\":\"$1\",\"base\":\"master\",\"title\":\"$2\",\"body\":\"$3\"}" "https://api.github.com/repos/${TRAVIS_REPO_SLUG}/pulls" -} - - -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") -if [ -z "$KEYCLOAK_VERSION" ]; then - echo "No Keycloak update found." - exit -fi -echo "Keycloak version $KEYCLOAK_VERSION available; updating..." - -BRANCH=feature/keycloak-update-$KEYCLOAK_VERSION -if git ls-remote -q --exit-code origin $BRANCH; then - echo "Branch $BRANCH already exists." - exit -fi - -if ! docker_tag_exists keycloak/keycloak $KEYCLOAK_VERSION; then - echo "Docker image for Keycloak $KEYCLOAK_VERSION not found, not updating." - exit -fi -echo "Found updated docker image, proceeding" - -mvn versions:set -DnewVersion=$KEYCLOAK_VERSION -DgenerateBackupPoms=false -sed -i "s/KEYCLOAK_VERSION=.*/KEYCLOAK_VERSION=$KEYCLOAK_VERSION/" .travis.yml - -setup_git -git checkout -b $BRANCH -git add pom.xml .travis.yml -git commit -m "Update to Keycloak $KEYCLOAK_VERSION" -git push --quiet --set-upstream origin-auth $BRANCH - -PR_TITLE="Update to Keycloak $KEYCLOAK_VERSION" -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" -echo "Created pull request '$PR_TITLE'"