From 795d9df1f8f8d74ba84665d96b8561e5da5e31ab Mon Sep 17 00:00:00 2001 From: Ingo Date: Thu, 11 Mar 2021 16:58:33 +0100 Subject: [PATCH] Create initial keycloak extension structure. --- .github/workflows/maven-publish.yml | 27 ++ .gitignore | 1 + docker-compose.yml | 13 + pom.xml | 247 ++++++++++++++++++ .../resources/jboss-deployment-structure.xml | 11 + src/test/start.sh | 16 ++ src/test/stop.sh | 12 + 7 files changed, 327 insertions(+) create mode 100644 .github/workflows/maven-publish.yml create mode 100644 .gitignore create mode 100644 docker-compose.yml create mode 100644 pom.xml create mode 100644 src/main/resources/jboss-deployment-structure.xml create mode 100755 src/test/start.sh create mode 100755 src/test/stop.sh diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml new file mode 100644 index 0000000..0e58d2e --- /dev/null +++ b/.github/workflows/maven-publish.yml @@ -0,0 +1,27 @@ +name: Release +on: + release: + types: + - created +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 11 + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Import GPG key + id: import_gpg + uses: crazy-max/ghaction-import-gpg@v3 + with: + gpg-private-key: ${{ secrets.GPG_SECRET }} + passphrase: ${{ secrets.GPG_PASSPHRASE }} + - name: Publish package + run: mvn --batch-mode deploy -DskipTests -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Dkeycloak.version=${GITHUB_REF##*/} -Dchangelist= + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b83d222 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e75ecf7 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.7' +services: + keycloak: + container_name: keycloak-sendinblue + image: jboss/keycloak:{{ KEYCLOAK_VERSION }} + ports: + - 18080:8080 + environment: + KEYCLOAK_USER: admin + KEYCLOAK_PASSWORD: keycloak + volumes: + - /etc/localtime:/etc/localtime:ro + - ./target/keycloak-sendinblue-{{ KEYCLOAK_VERSION }}.jar:/opt/jboss/keycloak/standalone/deployments/keycloak-sendinblue.jar diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..91a7be4 --- /dev/null +++ b/pom.xml @@ -0,0 +1,247 @@ + + + 4.0.0 + + de.intension + keycloak-sendinblue + ${keycloak.version}${changelist} + jar + + Keycloak Sendinblue + Keycloak addon to use the Sendinblue API for sending mails + https://github.com/intensiongmbh/keycloak-sendinblue + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + Ingo Kuba + ikuba@intension.de + https://github.com/ingokuba + intension GmbH + https://www.intension.de/ + + + + + scm:git:git://github.com/intensiongmbh/keycloak-sendinblue.git + scm:git:ssh://github.com:intensiongmbh/keycloak-sendinblue.git + https://github.com/intensiongmbh/keycloak-sendinblue/tree/master + + + + + ossrh + Central Repository OSSRH + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + 12.0.2 + -SNAPSHOT + 11 + ${java.version} + ${java.version} + ${java.version} + 1.18.18 + 2.22.2 + 5.7.1 + UTF-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.slf4j + slf4j-log4j12 + + + log4j + log4j + + + + + org.keycloak + keycloak-services + ${keycloak.version} + provided + + + org.slf4j + slf4j-log4j12 + + + + + org.projectlombok + lombok + ${lombok.version} + provided + true + + + org.junit.jupiter + junit-jupiter-api + ${junit-jupiter.version} + test + + + org.junit.jupiter + junit-jupiter-params + ${junit-jupiter.version} + test + + + org.junit.jupiter + junit-jupiter-engine + ${junit-jupiter.version} + test + + + org.hamcrest + hamcrest-all + 1.3 + test + + + com.fasterxml.jackson.core + jackson-core + 2.12.2 + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.test-plugins.version} + + + --illegal-access=permit -Xmx1024m -XX:MaxPermSize=256m + + + + + org.junit.platform + junit-platform-surefire-provider + 1.3.2 + + + org.junit.jupiter + junit-jupiter-engine + ${junit-jupiter.version} + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${maven.test-plugins.version} + + + --illegal-access=permit + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + true + + ossrh + https://s01.oss.sonatype.org/ + true + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + + true + + + org.keycloak.keycloak-core, org.keycloak.keycloak-server-spi, org.keycloak.keycloak-server-spi-private, org.keycloak.keycloak-services, + org.jboss.logging + + + + + + + + diff --git a/src/main/resources/jboss-deployment-structure.xml b/src/main/resources/jboss-deployment-structure.xml new file mode 100644 index 0000000..c8a8054 --- /dev/null +++ b/src/main/resources/jboss-deployment-structure.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/test/start.sh b/src/test/start.sh new file mode 100755 index 0000000..0b5eb8a --- /dev/null +++ b/src/test/start.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# build jar without SNAPSHOT suffix +mvn clean package -DskipTests -Dchangelist= +if [[ "$?" -ne 0 ]] ; then + echo 'could not run maven package'; exit $rc +fi +# get keycloak version from pom +KEYCLOAK_VERSION=$(mvn help:evaluate -Dexpression=keycloak.version -q -DforceStdout) +# save file content +dockerComposeFile=$( docker-compose.yml \ No newline at end of file diff --git a/src/test/stop.sh b/src/test/stop.sh new file mode 100755 index 0000000..2abbdd0 --- /dev/null +++ b/src/test/stop.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# get keycloak version from running container +keycloakImage=$(docker inspect keycloak-sendinblue -f '{{.Config.Image}}') +keycloakVersion="${keycloakImage#*:}" +# save file content +dockerComposeFile=$( docker-compose.yml \ No newline at end of file