95 lines
4.9 KiB
XML
95 lines
4.9 KiB
XML
<project name="keycloak-server-configuration" basedir="." >
|
|
|
|
<target name="check-configuration-state">
|
|
<available property="performance.configured" file="${project.build.directory}/performance-configured"/>
|
|
<available property="management.configured" file="${project.build.directory}/management-configured"/>
|
|
<available property="crossdc.configured" file="${project.build.directory}/crossdc-configured"/>
|
|
<echo>performance.configured: ${performance.configured}</echo>
|
|
<echo>management.configured: ${management.configured}</echo>
|
|
<echo>crossdc.configured: ${crossdc.configured}</echo>
|
|
</target>
|
|
|
|
<target name="keycloak-performance-configuration" unless="performance.configured" depends="check-configuration-state">
|
|
<echo>Applying keycloak performance configuration.</echo>
|
|
<chmod perm="ug+x">
|
|
<fileset dir="${server.unpacked.home}/bin">
|
|
<include name="*.sh"/>
|
|
</fileset>
|
|
</chmod>
|
|
<filter token="MODULE_NAME" value="${jdbc.driver.groupId}"/>
|
|
<filter token="RESOURCE_ROOT_PATH" value="${jdbc.driver.artifactId}-${jdbc.driver.version}.jar"/>
|
|
<copy file="${resources.dir}/module.xml"
|
|
todir="${server.unpacked.home}/modules/system/layers/base/${jdbc.driver.module.path}/main"
|
|
filtering="true"
|
|
/>
|
|
<copy todir="${server.unpacked.home}/bin" >
|
|
<fileset dir="${scripts.dir}/jboss-cli"/>
|
|
</copy>
|
|
<exec executable="./${jboss.cli.script}" dir="${server.unpacked.home}/bin" failonerror="true">
|
|
<arg value="--file=set-keycloak-ds.cli"/>
|
|
<env key="JBOSS_HOME" value="${server.unpacked.home}"/>
|
|
</exec>
|
|
<exec executable="./${jboss.cli.script}" dir="${server.unpacked.home}/bin" failonerror="true">
|
|
<arg value="--file=io-worker-threads.cli"/>
|
|
<env key="JBOSS_HOME" value="${server.unpacked.home}"/>
|
|
</exec>
|
|
<exec executable="./${jboss.cli.script}" dir="${server.unpacked.home}/bin" failonerror="true">
|
|
<arg value="--file=undertow.cli"/>
|
|
<env key="JBOSS_HOME" value="${server.unpacked.home}"/>
|
|
</exec>
|
|
<exec executable="./${jboss.cli.script}" dir="${server.unpacked.home}/bin" failonerror="true">
|
|
<arg value="--file=modcluster-simple-load-provider.cli"/>
|
|
<env key="JBOSS_HOME" value="${server.unpacked.home}"/>
|
|
</exec>
|
|
<exec executable="./${jboss.cli.script}" dir="${server.unpacked.home}/bin" failonerror="true">
|
|
<arg value="--file=io-worker-threads.cli"/>
|
|
<env key="JBOSS_HOME" value="${server.unpacked.home}"/>
|
|
</exec>
|
|
<delete dir="${server.unpacked.home}/standalone/configuration/standalone_xml_history"/>
|
|
<delete dir="${server.unpacked.home}/standalone/log"/>
|
|
<delete dir="${server.unpacked.home}/standalone/data"/>
|
|
<delete dir="${server.unpacked.home}/standalone/tmp"/>
|
|
<touch file="${project.build.directory}/performance-configured"/>
|
|
</target>
|
|
|
|
<target name="add-management-user" unless="management.configured" depends="check-configuration-state">
|
|
<echo>Adding management user: `${management.user}`</echo>
|
|
<exec executable="./${add.user.script}" dir="${server.unpacked.home}/bin" failonerror="true">
|
|
<arg value="-u"/>
|
|
<arg value="${management.user}"/>
|
|
<arg value="-p"/>
|
|
<arg value="${management.user.password}"/>
|
|
<env key="JBOSS_HOME" value="${server.unpacked.home}"/>
|
|
</exec>
|
|
<touch file="${project.build.directory}/management-configured"/>
|
|
</target>
|
|
|
|
<target name="keycloak-crossdc-configuration" unless="crossdc.configured" depends="check-configuration-state">
|
|
<echo>keycloak-crossdc-configuration</echo>
|
|
<exec executable="./${jboss.cli.script}" dir="${server.unpacked.home}/bin" failonerror="true">
|
|
<arg value="--file=add-remote-cache-stores.cli"/>
|
|
<env key="JBOSS_HOME" value="${server.unpacked.home}"/>
|
|
</exec>
|
|
<delete dir="${server.unpacked.home}/standalone/configuration/standalone_xml_history"/>
|
|
<delete dir="${server.unpacked.home}/standalone/log"/>
|
|
<delete dir="${server.unpacked.home}/standalone/data"/>
|
|
<delete dir="${server.unpacked.home}/standalone/tmp"/>
|
|
<touch file="${project.build.directory}/crossdc-configured"/>
|
|
</target>
|
|
|
|
|
|
<target name="keycloak-docker">
|
|
<copy todir="${project.build.directory}/docker" overwrite="false">
|
|
<fileset dir="${scripts.dir}">
|
|
<include name="Dockerfile"/>
|
|
<include name="*.sh"/>
|
|
</fileset>
|
|
</copy>
|
|
<copy todir="${project.build.directory}/docker/keycloak" overwrite="false">
|
|
<fileset dir="${server.unpacked.home}">
|
|
<exclude name="bin/*.cli"/>
|
|
</fileset>
|
|
</copy>
|
|
</target>
|
|
|
|
</project>
|