2014-09-30 17:50:17 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-10-02 15:42:11 +00:00
|
|
|
## Deploy and configure all examples
|
2014-09-30 17:50:17 +00:00
|
|
|
|
|
|
|
# Deploy examples
|
|
|
|
cd /keycloak-docker-cluster/examples
|
2014-10-07 10:33:27 +00:00
|
|
|
for I in $(find . | grep .war$); do cp $I $JBOSS_HOME/standalone/deployments/; done;
|
2014-09-30 17:50:17 +00:00
|
|
|
|
|
|
|
# Explode wars
|
2014-10-07 10:33:27 +00:00
|
|
|
cd $JBOSS_HOME/standalone/deployments/
|
2014-09-30 17:50:17 +00:00
|
|
|
for I in $(ls -d *.war | grep -v auth-server.war); do
|
2014-10-01 07:52:00 +00:00
|
|
|
echo "Configuring $I";
|
2014-09-30 17:50:17 +00:00
|
|
|
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
|
2014-10-02 15:42:11 +00:00
|
|
|
sed -i -e 's/\"\/auth\",/&\n \"auth-server-url-for-backend-requests\": \"http:\/\/\$\{jboss.host.name\}:8080\/auth\",/' $I;
|
2014-09-30 17:50:17 +00:00
|
|
|
done;
|
|
|
|
|
2014-10-01 09:52:16 +00:00
|
|
|
# Enable distributable for customer-portal
|
|
|
|
sed -i -e 's/<\/module-name>/&\n <distributable \/>/' customer-portal.war/WEB-INF/web.xml
|
|
|
|
|
2014-10-02 15:42:11 +00:00
|
|
|
# Configure testrealm.json - Enable adminUrl to access adapters on local machine
|
|
|
|
sed -i -e 's/\"adminUrl\": \"/&http:\/\/\$\{jboss.host.name\}:8080/' /keycloak-docker-cluster/examples/testrealm.json
|
|
|
|
|
2014-09-30 17:50:17 +00:00
|
|
|
|