Changeset View
Changeset View
Standalone View
Standalone View
docker/services/keycloak/entrypoint.sh
#!/bin/bash | #!/bin/bash | ||||
# turn on bash's job control | # turn on bash's job control | ||||
set -m | set -m | ||||
cd | cd | ||||
if [ ! -d swh-keycloak-theme ] | if [ ! -d swh-keycloak-theme ] | ||||
then | then | ||||
git clone https://forge.softwareheritage.org/source/swh-keycloak-theme.git | git clone https://forge.softwareheritage.org/source/swh-keycloak-theme.git | ||||
ln -s /opt/jboss/swh-keycloak-theme/swh/ /opt/jboss/keycloak/themes/swh | cp -r /opt/jboss/swh-keycloak-theme/swh /opt/jboss/keycloak/themes/swh | ||||
fi | fi | ||||
echo "Starting Keycloak" | echo "Starting Keycloak" | ||||
/opt/jboss/tools/docker-entrypoint.sh -b 0.0.0.0& | /opt/jboss/tools/docker-entrypoint.sh -b 0.0.0.0& | ||||
echo "Waiting for Keycloak server to be up" | echo "Waiting for Keycloak server to be up" | ||||
/wait-for-it.sh localhost:8080 -s --timeout=0 | /wait-for-it.sh localhost:8080 -s --timeout=0 | ||||
echo "Configuring Keycloak to be used in docker environment" | echo "Configuring Keycloak to be used in docker environment" | ||||
echo "and creating some test users in the SoftwareHeritage realm" | echo "and creating some test users in the SoftwareHeritage realm" | ||||
/keycloak_swh_setup.py | /keycloak_swh_setup.py | ||||
fg %1 | fg %1 | ||||