diff --git a/server/src/main/resources/META-INF/keycloak-server.json b/server/src/main/resources/META-INF/keycloak-server.json index d58d1b2807..d9249ddc17 100755 --- a/server/src/main/resources/META-INF/keycloak-server.json +++ b/server/src/main/resources/META-INF/keycloak-server.json @@ -68,5 +68,11 @@ "dataSource": "java:jboss/datasources/KeycloakDS", "databaseSchema": "update" } + }, + + "connectionsInfinispan": { + "default": { + "cacheContainer" : "java:jboss/infinispan/Keycloak" + } } } \ No newline at end of file diff --git a/testsuite/docker-cluster/wildfly/deploy-examples.sh b/testsuite/docker-cluster/wildfly/deploy-examples.sh index d102dc235b..f2173370ba 100644 --- a/testsuite/docker-cluster/wildfly/deploy-examples.sh +++ b/testsuite/docker-cluster/wildfly/deploy-examples.sh @@ -9,7 +9,7 @@ for I in $(find . | grep .war$); do cp $I /opt/wildfly/standalone/deployments/; # Explode wars cd /opt/wildfly/standalone/deployments/ for I in $(ls -d *.war | grep -v auth-server.war); do - echo "Explode dir $I"; + echo "Configuring $I"; mkdir $I.tmp; cd $I.tmp; unzip -q ../$I; @@ -25,7 +25,6 @@ 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; diff --git a/testsuite/docker-cluster/wildfly/keycloak-run-node.sh b/testsuite/docker-cluster/wildfly/keycloak-run-node.sh index 40603f9d86..96b37278d5 100644 --- a/testsuite/docker-cluster/wildfly/keycloak-run-node.sh +++ b/testsuite/docker-cluster/wildfly/keycloak-run-node.sh @@ -3,6 +3,34 @@ export MYHOST=node$(echo $MYSQL_NAME | awk -F"/dockercluster[^0-9]*|\/mysql" '{print $2 }'); echo "MYHOST is $MYHOST. MYSQL_NAME is $MYSQL_NAME"; +function prepareHost +{ + if [ -d /keycloak-docker-shared/keycloak-wildfly-$MYHOST ]; then + echo "Node $MYHOST already prepared. Skiping"; + return; + fi + + echo "Creating keycloak-wildfly-$MYHOST"; + + cd /opt/wildfly + cp -r /keycloak-docker-cluster/modules ./ + + # Deploy keycloak + cp -r /keycloak-docker-cluster/deployments/* /opt/wildfly/standalone/deployments/ + + # Enable Infinispan provider + sed -i "s|keycloak.userSessions.provider:mem|keycloak.userSessions.provider:infinispan|" /opt/wildfly/standalone/deployments/auth-server.war/WEB-INF/classes/META-INF/keycloak-server.json + + # Deploy and configure examples + /deploy-examples.sh + + # Deploy to volume + rm -rf /keycloak-docker-shared/keycloak-wildfly-$MYHOST + cp -r /opt/wildfly-8.1.0.Final /keycloak-docker-shared/keycloak-wildfly-$MYHOST + chmod -R 777 /keycloak-docker-shared/keycloak-wildfly-$MYHOST + echo "keycloak-wildfly-$MYHOST prepared and copyied to volume"; +} + function waitForPreviousNodeStart { myHostNumber=$(echo $MYHOST | awk -F"node" '{ print $2 }'); @@ -42,23 +70,7 @@ function waitForMySQLStart done; } -echo "Creating keycloak-wildfly-$MYHOST"; - -cd /opt/wildfly -cp -r /keycloak-docker-cluster/modules ./ - -# Deploy keycloak -cp -r /keycloak-docker-cluster/deployments/* /opt/wildfly/standalone/deployments/ - -# Deploy and configure examples -/deploy-examples.sh - -# Deploy to volume -rm -rf /keycloak-docker-shared/keycloak-wildfly-$MYHOST -cp -r /opt/wildfly-8.1.0.Final /keycloak-docker-shared/keycloak-wildfly-$MYHOST -chmod -R 777 /keycloak-docker-shared/keycloak-wildfly-$MYHOST -echo "keycloak-wildfly-$MYHOST prepared and copyied to volume"; - +prepareHost; waitForPreviousNodeStart; waitForMySQLStart;