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
|
|
|
|
|
2014-10-05 20:12:54 +00:00
|
|
|
# Enforce refreshing token for product-portal and customer-portal war
|
2014-10-06 11:04:14 +00:00
|
|
|
# sed -i -e 's/\"\/auth\",/&\n \"always-refresh-token\": true,/' customer-portal.war/WEB-INF/keycloak.json;
|
2014-10-09 16:38:59 +00:00
|
|
|
# sed -i -e 's/\"\/auth\",/&\n \"always-refresh-token\": true,/' product-portal.war/WEB-INF/keycloak.json;
|
2014-10-05 20:12:54 +00:00
|
|
|
|
2014-09-30 17:50:17 +00:00
|
|
|
# Configure other examples
|
|
|
|
for I in *.war/WEB-INF/keycloak.json; do
|
2014-10-09 16:38:59 +00:00
|
|
|
sed -i -e 's/\"auth-server-url\".*: \"\/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
|
2014-10-09 16:38:59 +00:00
|
|
|
sed -i -e 's/\"adminUrl\": \"\/customer-portal/\"adminUrl\": \"http:\/\/\$\{jboss.host.name\}:8080\/customer-portal/' /keycloak-docker-cluster/examples/testrealm.json
|
2014-10-09 18:11:44 +00:00
|
|
|
sed -i -e 's/\"adminUrl\": \"\/product-portal/\"adminUrl\": \"http:\/\/\$\{kc_session_host\}:8080\/product-portal/' /keycloak-docker-cluster/examples/testrealm.json
|
2014-10-02 15:42:11 +00:00
|
|
|
|
2014-09-30 17:50:17 +00:00
|
|
|
|