Skip to content

Commit

Permalink
Add build-and-deploy details for theme jar
Browse files Browse the repository at this point in the history
Add specific details regarding deployment of the theme jar so that
anyone on the team would be able to deploy with more confidence and
less head-scratching.
  • Loading branch information
bickelj committed Mar 14, 2024
1 parent 05793e4 commit 330360d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions pdc-keycloak-theme/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,33 @@ Start in the `pdc-keycloak-theme` directory

The resulting jar should be in `build/libs`. This theme jar is what should be included in keycloak's `/providers` directory.

If deploying this jar, you should rename it based on the git commit. Example:
- `cp build/libs/pdc-keycloak-theme.jar pdc-keycloak-theme-20240313-05793e4.jar`

The version id here is the UTC date of the commit followed by the first seven digits of the commit SHA1 sum.

## How to deploy

If there is already a `pdc-keycloak-theme...jar` present in the Keycloak `providers` directory, move this one out when deploying a new one. The goal is to have exactly one version of this jar present on the classpath.

Example commands that copied a new jar, moved the old jar, and chowned the new:

- `sudo cp pdc-keycloak-theme-20240313-05793e4.jar /opt/keycloak/keycloak-23.0.5/providers/`
- `sudo mv /opt/keycloak/keycloak-23.0.5/providers/pdc-keycloak-theme-20230407-6b4b74d.jar /opt/keycloak/`
- `sudo chown keycloak:keycloak /opt/keycloak/keycloak-23.0.5/providers/pdc-keycloak-theme*.jar`

Rebuild Keycloak's configuration. Example:

- `sudo -u keycloak /bin/bash`
- `cd /opt/keycloak/keycloak-23.0.5`
- `bin/kc.sh build`
- `exit`
- `sudo systemctl restart keycloak`

To verify that everything is OK, look at the logs. Example:

- `sudo journalctl --since '2024-03-13 00:00:00' | grep -C 5 -i keycloak`

## Source Sans Pro font asset handling

Font assets, including font-specific CSS, are added to the jar during the build via the `unpackSourceSansPro` task on which the `jar` task depends. There is no need to explicitly run this task but if you change the `unpackSourceSansPro` task code you may need to `../gradlew clean jar` to get up-to-date results.
Expand Down

0 comments on commit 330360d

Please sign in to comment.