KEYCLOAK-3597 - Arquillian testuite - server preparation (overlay & patches installation)

This commit is contained in:
Pavel Drozd 2016-09-20 13:00:54 +02:00
parent 4977527f60
commit 59eec8d5b4
9 changed files with 131 additions and 39 deletions

View file

@ -72,6 +72,7 @@
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<version>${version.shrinkwrap.resolvers}</version>
<scope>test</scope>
</dependency>
<dependency>

View file

@ -0,0 +1,9 @@
set NOPAUSE=true
for %%a in ("%APP_PATCH_ZIPS:,=" "%") do (
call %JBOSS_HOME%\bin\jboss-cli.bat --command="patch apply %%~a"
if %ERRORLEVEL% neq 0 set ERROR=%ERRORLEVEL%
)
exit /b %ERROR%

View file

@ -0,0 +1,18 @@
#!/bin/bash
echo "JBOSS_HOME=$JBOSS_HOME"
if [ ! -d "$JBOSS_HOME/bin" ] ; then
>&2 echo "JBOSS_HOME/bin doesn't exist"
exit 1
fi
cd $JBOSS_HOME/bin
RESULT=0
patches=$(echo $APP_PATCH_ZIPS | tr "," "\n")
for patch in $patches
do
./jboss-cli.sh --command="patch apply $patch"
if [ $? -ne 0 ]; then exit 1; fi
done
exit 0

View file

@ -193,17 +193,17 @@
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${common.resources}/install-adapters.${script.suffix}</executable>
<workingDirectory>${app.server.jboss.home}/bin</workingDirectory>
<environmentVariables>
<JAVA_HOME>${app.server.java.home}</JAVA_HOME>
<JBOSS_HOME>${app.server.jboss.home}</JBOSS_HOME>
<SAML_SUPPORTED>${app.server.saml.adapter.supported}</SAML_SUPPORTED>
</environmentVariables>
</configuration>
</execution>
</executions>
<configuration>
<executable>${common.resources}/install-adapters.${script.suffix}</executable>
<workingDirectory>${app.server.jboss.home}/bin</workingDirectory>
<environmentVariables>
<JAVA_HOME>${app.server.java.home}</JAVA_HOME>
<JBOSS_HOME>${app.server.jboss.home}</JBOSS_HOME>
<SAML_SUPPORTED>${app.server.saml.adapter.supported}</SAML_SUPPORTED>
</environmentVariables>
</configuration>
</plugin>
<plugin>
@ -284,7 +284,42 @@
</plugins>
</build>
</profile>
<profile>
<id>app-server-apply-patches</id>
<activation>
<property>
<name>app.server.patch.zips</name>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>install-patches</id>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${common.resources}/install-patch.${script.suffix}</executable>
<workingDirectory>${app.server.home}/bin</workingDirectory>
<environmentVariables>
<JAVA_HOME>${app.server.java.home}</JAVA_HOME>
<JBOSS_HOME>${app.server.jboss.home}</JBOSS_HOME>
<APP_PATCH_ZIPS>${app.server.patch.zips}</APP_PATCH_ZIPS>
</environmentVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>ssl</id>
<activation>

View file

@ -0,0 +1,7 @@
set NOPAUSE=true
call %JBOSS_HOME%\bin\jboss-cli.bat --file=keycloak-install.cli
if %ERRORLEVEL% neq 0 set ERROR=%ERRORLEVEL%
exit /b %ERROR%

View file

@ -0,0 +1,17 @@
#!/bin/bash
echo "JBOSS_HOME=$JBOSS_HOME"
if [ ! -d "$JBOSS_HOME/bin" ] ; then
>&2 echo "JBOSS_HOME/bin doesn't exist"
exit 1
fi
cd $JBOSS_HOME/bin
RESULT=0
./jboss-cli.sh --file=keycloak-install.cli
if [ $? -ne 0 ]; then RESULT=1; fi
exit $RESULT
fi
exit 1

View file

@ -1,7 +1,9 @@
set NOPAUSE=true
call %JBOSS_HOME%\bin\jboss-cli.bat --command="patch apply %PATCH_ZIP%"
for %%a in ("%APP_PATCH_ZIPS:,=" "%") do (
call %JBOSS_HOME%\bin\jboss-cli.bat --command="patch apply %%~a"
if %ERRORLEVEL% neq 0 set ERROR=%ERRORLEVEL%
exit /b %ERROR%
if %ERRORLEVEL% neq 0 set ERROR=%ERRORLEVEL%
)
exit /b %ERROR%

View file

@ -9,9 +9,10 @@ fi
cd $JBOSS_HOME/bin
RESULT=0
./jboss-cli.sh --command="patch apply $PATCH_ZIP"
if [ $? -ne 0 ]; then RESULT=1; fi
exit $RESULT
fi
exit 1
patches=$(echo $AUTH_PATCH_ZIPS | tr "," "\n")
for patch in $patches
do
./jboss-cli.sh --command="patch apply $patch"
if [ $? -ne 0 ]; then exit 1; fi
done
exit 0

View file

@ -279,9 +279,9 @@
</activation>
<properties>
<!--override default unpacked artifact with server-overlay-->
<unpacked.artifact.groupId>${auth.server.overlay.groupId}</unpacked.artifact.groupId>
<unpacked.artifact.artifactId>${auth.server.overlay.artifactId}</unpacked.artifact.artifactId>
<unpacked.artifact.version>${auth.server.overlay.version}</unpacked.artifact.version>
<unpacked.artifact.groupId>${overlaid.container.groupId}</unpacked.artifact.groupId>
<unpacked.artifact.artifactId>${overlaid.container.artifactId}</unpacked.artifact.artifactId>
<unpacked.artifact.version>${overlaid.container.version}</unpacked.artifact.version>
<auth.server.home>${project.build.directory}/unpacked/${overlaid.container.unpacked.folder.name}</auth.server.home>
</properties>
<build>
@ -299,11 +299,11 @@
<configuration>
<artifactItems>
<artifactItem>
<groupId>${overlaid.container.groupId}</groupId>
<artifactId>${overlaid.container.artifactId}</artifactId>
<version>${overlaid.container.version}</version>
<groupId>${auth.server.overlay.groupId}</groupId>
<artifactId>${auth.server.overlay.artifactId}</artifactId>
<version>${auth.server.overlay.version}</version>
<type>zip</type>
<outputDirectory>${auth.server.home}</outputDirectory>
<outputDirectory>${project.build.directory}/unpacked/${overlaid.container.unpacked.folder.name}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
@ -311,23 +311,25 @@
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>move-standalone-keycloak-xml</id>
<phase>process-resources</phase>
<id>install-server-overlay</id>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
<goal>exec</goal>
</goals>
<configuration>
<tasks>
<move file="${auth.server.home}/standalone/configuration/standalone-keycloak.xml"
tofile="${auth.server.home}/standalone/configuration/standalone.xml"/>
</tasks>
</configuration>
</execution>
</executions>
<configuration>
<executable>${common.resources}/install-keycloak.${script.suffix}</executable>
<workingDirectory>${auth.server.home}/bin</workingDirectory>
<environmentVariables>
<JAVA_HOME>${auth.server.java.home}</JAVA_HOME>
<JBOSS_HOME>${auth.server.home}</JBOSS_HOME>
</environmentVariables>
</configuration>
</plugin>
</plugins>
</pluginManagement>
@ -545,7 +547,7 @@
<id>auth-server-apply-patch</id>
<activation>
<property>
<name>auth.server.patch.zip</name>
<name>auth.server.patch.zips</name>
</property>
</activation>
<build>
@ -569,7 +571,7 @@
<environmentVariables>
<JAVA_HOME>${auth.server.java.home}</JAVA_HOME>
<JBOSS_HOME>${auth.server.home}</JBOSS_HOME>
<PATCH_ZIP>${auth.server.patch.zip}</PATCH_ZIP>
<AUTH_PATCH_ZIPS>${auth.server.patch.zips}</AUTH_PATCH_ZIPS>
</environmentVariables>
</configuration>
</plugin>