Make examples working in docker cluster env

This commit is contained in:
mposolda 2014-09-30 19:50:17 +02:00
parent 80a9a8984a
commit 89dc55a106
3 changed files with 36 additions and 3 deletions

View file

@ -29,6 +29,8 @@ RUN sed -i "s|#JAVA_OPTS=\"\$JAVA_OPTS -agentlib:jdwp=transport=dt_socket|JAVA_O
ADD mysql-keycloak-ds.xml /opt/wildfly/standalone/deployments/
ADD keycloak-run-node.sh /keycloak-run-node.sh
RUN chmod u+x /keycloak-run-node.sh
ADD deploy-examples.sh /deploy-examples.sh
RUN chmod u+x /deploy-examples.sh
EXPOSE 8787

View file

@ -0,0 +1,32 @@
#!/bin/bash
# Deploy and configure all examples
# Deploy examples
cd /keycloak-docker-cluster/examples
for I in $(find . | grep .war$); do cp $I /opt/wildfly/standalone/deployments/; done;
# Explode wars
cd /opt/wildfly/standalone/deployments/
for I in $(ls -d *.war | grep -v auth-server.war); do
echo "Explode dir $I";
mkdir $I.tmp;
cd $I.tmp;
unzip -q ../$I;
cd ..
rm $I;
mv $I.tmp $I;
touch $I.dodeploy;
done;
# Configure admin-access.war
sed -i -e 's/false/true/' admin-access.war/WEB-INF/web.xml
# Configure other examples
for I in *.war/WEB-INF/keycloak.json; do
echo "Configuring $I";
sed -i -e 's/\"use-hostname-for-local-requests\": false/\"use-hostname-for-local-requests\": true/' $I;
done;

View file

@ -50,9 +50,8 @@ cp -r /keycloak-docker-cluster/modules ./
# Deploy keycloak
cp -r /keycloak-docker-cluster/deployments/* /opt/wildfly/standalone/deployments/
# Deploy examples
cd /keycloak-docker-cluster/examples
for I in $(find . | grep .war$); do cp $I /opt/wildfly/standalone/deployments/; done;
# Deploy and configure examples
/deploy-examples.sh
# Deploy to volume
rm -rf /keycloak-docker-shared/keycloak-wildfly-$MYHOST