109 lines
5.3 KiB
XML
109 lines
5.3 KiB
XML
<project name="infinispan" basedir="." >
|
|
|
|
<target name="download-infinispan">
|
|
<property environment="env"/>
|
|
<property name="infinispan.zip.filename" value="infinispan-server-${infinispan.version}.zip"/>
|
|
<property name="infinispan.zip.src" value="https://downloads.jboss.org/infinispan/${infinispan.version}"/>
|
|
<property name="infinispan.zip.dir" value="${env.HOME}/.m2/repository/org/infinispan/server/infinispan-server/${infinispan.version}"/>
|
|
<mkdir dir="${infinispan.zip.dir}"/>
|
|
<get
|
|
src="${infinispan.zip.src}/${infinispan.zip.filename}"
|
|
dest="${infinispan.zip.dir}/"
|
|
usetimestamp="true"
|
|
verbose="true"
|
|
/>
|
|
<echo file="${infinispan.zip.dir}/info.txt" append="false">This artifact was downloaded from: ${infinispan.zip.src}/${infinispan.zip.filename}</echo>
|
|
<unzip
|
|
src="${infinispan.zip.dir}/${infinispan.zip.filename}" dest="${project.build.directory}"
|
|
overwrite="false"
|
|
/>
|
|
</target>
|
|
|
|
<target name="check-configuration-state" >
|
|
<available property="configured" file="${infinispan.unpacked.home}/../configured"/>
|
|
<available property="management.configured" file="${infinispan.unpacked.home}/../management-configured"/>
|
|
<echo>configured: ${configured}</echo>
|
|
<echo>management.configured: ${management.configured}</echo>
|
|
</target>
|
|
|
|
<target name="configure-infinispan" unless="configured" depends="check-configuration-state">
|
|
<!-- configuration common for both DC sites-->
|
|
<chmod perm="ug+x">
|
|
<fileset dir="${infinispan.unpacked.home}/bin">
|
|
<include name="*.sh"/>
|
|
</fileset>
|
|
</chmod>
|
|
<copy file="${scripts.dir}/jboss-cli/add-private-network-interface.cli" todir="${infinispan.unpacked.home}/bin" />
|
|
<exec executable="./${jboss.cli.script}" dir="${infinispan.unpacked.home}/bin" failonerror="true">
|
|
<arg value="--file=add-private-network-interface.cli"/>
|
|
</exec>
|
|
|
|
<!-- DC-specific configuration (dc1 and dc2) -->
|
|
<copy file="${infinispan.unpacked.home}/standalone/configuration/clustered.xml"
|
|
tofile="${infinispan.unpacked.home}/standalone/configuration/clustered-dc1.xml" />
|
|
<move file="${infinispan.unpacked.home}/standalone/configuration/clustered.xml"
|
|
tofile="${infinispan.unpacked.home}/standalone/configuration/clustered-dc2.xml" />
|
|
<copy file="${scripts.dir}/jboss-cli/add-keycloak-caches.cli" tofile="${infinispan.unpacked.home}/bin/add-keycloak-caches-dc1.cli" >
|
|
<filterset>
|
|
<filter token="LOCAL_SITE" value="dc1"/>
|
|
<filter token="REMOTE_SITE" value="dc2"/>
|
|
</filterset>
|
|
</copy>
|
|
<copy file="${scripts.dir}/jboss-cli/add-keycloak-caches.cli" tofile="${infinispan.unpacked.home}/bin/add-keycloak-caches-dc2.cli" >
|
|
<filterset>
|
|
<filter token="LOCAL_SITE" value="dc2"/>
|
|
<filter token="REMOTE_SITE" value="dc1"/>
|
|
</filterset>
|
|
</copy>
|
|
<exec executable="./${jboss.cli.script}" dir="${infinispan.unpacked.home}/bin" failonerror="true">
|
|
<arg value="--file=add-keycloak-caches-dc1.cli"/>
|
|
</exec>
|
|
<exec executable="./${jboss.cli.script}" dir="${infinispan.unpacked.home}/bin" failonerror="true">
|
|
<arg value="--file=add-keycloak-caches-dc2.cli"/>
|
|
</exec>
|
|
|
|
<!--cleanup-->
|
|
<delete dir="${infinispan.unpacked.home}/standalone/configuration/standalone_xml_history"/>
|
|
<delete dir="${infinispan.unpacked.home}/standalone/log"/>
|
|
<delete dir="${infinispan.unpacked.home}/standalone/data"/>
|
|
<delete dir="${infinispan.unpacked.home}/standalone/tmp"/>
|
|
<replace file="${infinispan.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>
|
|
<touch file="${infinispan.unpacked.home}/../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="${infinispan.unpacked.home}/bin" failonerror="true">
|
|
<arg value="-u"/>
|
|
<arg value="${management.user}"/>
|
|
<arg value="-p"/>
|
|
<arg value="${management.user.password}"/>
|
|
</exec>
|
|
<touch file="${infinispan.unpacked.home}/../management-configured"/>
|
|
</target>
|
|
|
|
<target name="prepare-docker-config">
|
|
<copy todir="${infinispan.unpacked.home}/../docker" overwrite="false">
|
|
<fileset dir="${scripts.dir}">
|
|
<include name="Dockerfile"/>
|
|
<include name="*.sh"/>
|
|
</fileset>
|
|
</copy>
|
|
<copy todir="${infinispan.unpacked.home}/../docker/infinispan-server" overwrite="false">
|
|
<fileset dir="${infinispan.unpacked.home}">
|
|
<exclude name="bin/*.cli"/>
|
|
</fileset>
|
|
</copy>
|
|
</target>
|
|
|
|
</project>
|