2017-11-14 18:58:55 +00:00
|
|
|
<project name="keycloak-server-configuration" basedir="." >
|
|
|
|
|
2017-12-04 14:52:21 +00:00
|
|
|
<target name="check-configuration-state">
|
2017-11-14 18:58:55 +00:00
|
|
|
<available property="performance.configured" file="${project.build.directory}/performance-configured"/>
|
2017-12-04 14:52:21 +00:00
|
|
|
<available property="management.configured" file="${project.build.directory}/management-configured"/>
|
|
|
|
<available property="crossdc.configured" file="${project.build.directory}/crossdc-configured"/>
|
2017-11-14 18:58:55 +00:00
|
|
|
<echo>performance.configured: ${performance.configured}</echo>
|
2017-12-04 14:52:21 +00:00
|
|
|
<echo>management.configured: ${management.configured}</echo>
|
|
|
|
<echo>crossdc.configured: ${crossdc.configured}</echo>
|
2017-11-14 18:58:55 +00:00
|
|
|
</target>
|
|
|
|
|
2017-12-04 14:52:21 +00:00
|
|
|
<target name="keycloak-performance-configuration" unless="performance.configured" depends="check-configuration-state">
|
|
|
|
<echo>Applying keycloak performance configuration.</echo>
|
2017-11-14 18:58:55 +00:00
|
|
|
<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"/>
|
2017-12-04 14:52:21 +00:00
|
|
|
<env key="JBOSS_HOME" value="${server.unpacked.home}"/>
|
2017-11-14 18:58:55 +00:00
|
|
|
</exec>
|
|
|
|
<exec executable="./${jboss.cli.script}" dir="${server.unpacked.home}/bin" failonerror="true">
|
|
|
|
<arg value="--file=io-worker-threads.cli"/>
|
2017-12-04 14:52:21 +00:00
|
|
|
<env key="JBOSS_HOME" value="${server.unpacked.home}"/>
|
2017-11-14 18:58:55 +00:00
|
|
|
</exec>
|
|
|
|
<exec executable="./${jboss.cli.script}" dir="${server.unpacked.home}/bin" failonerror="true">
|
|
|
|
<arg value="--file=undertow.cli"/>
|
2017-12-04 14:52:21 +00:00
|
|
|
<env key="JBOSS_HOME" value="${server.unpacked.home}"/>
|
2017-11-14 18:58:55 +00:00
|
|
|
</exec>
|
|
|
|
<exec executable="./${jboss.cli.script}" dir="${server.unpacked.home}/bin" failonerror="true">
|
|
|
|
<arg value="--file=io-worker-threads.cli"/>
|
2017-12-04 14:52:21 +00:00
|
|
|
<env key="JBOSS_HOME" value="${server.unpacked.home}"/>
|
2017-11-14 18:58:55 +00:00
|
|
|
</exec>
|
2017-12-04 14:52:21 +00:00
|
|
|
<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"/>
|
2018-11-15 03:48:46 +00:00
|
|
|
<replace file="${server.unpacked.home}/bin/standalone.sh">
|
|
|
|
<replacetoken><![CDATA[JBOSS_PID=$!]]></replacetoken>
|
|
|
|
<replacevalue><![CDATA[JBOSS_PID=$!
|
|
|
|
|
|
|
|
if [ "$JSTAT" = "true" ] ; then
|
|
|
|
echo "Starting jstat"
|
|
|
|
mkdir -p $JBOSS_LOG_DIR
|
|
|
|
jstat -gc -t $JBOSS_PID 1000 > $JBOSS_LOG_DIR/jstat-gc.log &
|
|
|
|
fi
|
|
|
|
]]></replacevalue>
|
|
|
|
</replace>
|
2017-12-04 14:52:21 +00:00
|
|
|
<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>
|
2017-11-14 18:58:55 +00:00
|
|
|
<exec executable="./${add.user.script}" dir="${server.unpacked.home}/bin" failonerror="true">
|
|
|
|
<arg value="-u"/>
|
2017-12-04 14:52:21 +00:00
|
|
|
<arg value="${management.user}"/>
|
2017-11-14 18:58:55 +00:00
|
|
|
<arg value="-p"/>
|
2017-12-04 14:52:21 +00:00
|
|
|
<arg value="${management.user.password}"/>
|
|
|
|
<env key="JBOSS_HOME" value="${server.unpacked.home}"/>
|
2017-11-14 18:58:55 +00:00
|
|
|
</exec>
|
2017-12-04 14:52:21 +00:00
|
|
|
<touch file="${project.build.directory}/management-configured"/>
|
2017-11-14 18:58:55 +00:00
|
|
|
</target>
|
|
|
|
|
2017-12-04 14:52:21 +00:00
|
|
|
<target name="keycloak-crossdc-configuration" unless="crossdc.configured" depends="check-configuration-state">
|
2017-11-14 18:58:55 +00:00
|
|
|
<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"/>
|
2017-12-04 14:52:21 +00:00
|
|
|
<env key="JBOSS_HOME" value="${server.unpacked.home}"/>
|
2017-11-14 18:58:55 +00:00
|
|
|
</exec>
|
|
|
|
<delete dir="${server.unpacked.home}/standalone/configuration/standalone_xml_history"/>
|
2017-12-04 14:52:21 +00:00
|
|
|
<delete dir="${server.unpacked.home}/standalone/log"/>
|
|
|
|
<delete dir="${server.unpacked.home}/standalone/data"/>
|
|
|
|
<delete dir="${server.unpacked.home}/standalone/tmp"/>
|
2017-11-14 18:58:55 +00:00
|
|
|
<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>
|