2018-06-06 02:53:44 +00:00
|
|
|
<project>
|
|
|
|
|
2019-03-08 12:27:29 +00:00
|
|
|
<property name="cli.tmp.dir" value="${project.build.directory}/cli" />
|
|
|
|
|
|
|
|
<target name="set-server-config">
|
|
|
|
<condition property="server.config" value="standalone.xml">
|
|
|
|
<equals arg1="${ant.scenario}" arg2="scenario-standalone"/>
|
|
|
|
</condition>
|
|
|
|
<condition property="server.config" value="standalone-ha.xml">
|
|
|
|
<or>
|
|
|
|
<equals arg1="${ant.scenario}" arg2="scenario-cluster"/>
|
|
|
|
<equals arg1="${ant.scenario}" arg2="scenario-crossdc"/>
|
|
|
|
</or>
|
|
|
|
</condition>
|
|
|
|
<fail message="Property $${ant.scenario} must be set.">
|
|
|
|
<condition>
|
|
|
|
<not>
|
|
|
|
<isset property="server.config" />
|
|
|
|
</not>
|
|
|
|
</condition>
|
|
|
|
</fail>
|
|
|
|
<echo>server.config: ${server.config}</echo>
|
2018-06-06 02:53:44 +00:00
|
|
|
</target>
|
2019-03-08 12:27:29 +00:00
|
|
|
|
2018-06-06 02:53:44 +00:00
|
|
|
<macrodef name="bin-chmod">
|
|
|
|
<sequential>
|
|
|
|
<chmod perm="ug+x">
|
|
|
|
<fileset dir="${auth.server.home}/bin">
|
|
|
|
<include name="*.sh"/>
|
|
|
|
</fileset>
|
|
|
|
</chmod>
|
|
|
|
</sequential>
|
|
|
|
</macrodef>
|
2019-03-08 12:27:29 +00:00
|
|
|
|
2018-06-06 02:53:44 +00:00
|
|
|
<macrodef name="cleanup">
|
|
|
|
<sequential>
|
|
|
|
<delete dir="${auth.server.home}/standalone/configuration/standalone_xml_history"/>
|
|
|
|
<delete dir="${auth.server.home}/standalone/log"/>
|
|
|
|
<delete dir="${auth.server.home}/standalone/data"/>
|
|
|
|
<delete dir="${auth.server.home}/standalone/tmp"/>
|
|
|
|
</sequential>
|
2018-09-24 08:49:47 +00:00
|
|
|
</macrodef>
|
2019-03-08 12:27:29 +00:00
|
|
|
|
|
|
|
<target name="apply-cli-scripts" depends="set-server-config">
|
|
|
|
<concat destfile="${cli.tmp.dir}/result.cli" fixlastline="true">
|
|
|
|
<header filtering="no" trimleading="yes">
|
|
|
|
embed-server --server-config=${server.config}
|
|
|
|
</header>
|
|
|
|
<fileset dir="${cli.tmp.dir}" includes="*.cli"/>
|
|
|
|
</concat>
|
2018-06-06 02:53:44 +00:00
|
|
|
<bin-chmod/>
|
2021-03-16 07:10:32 +00:00
|
|
|
<!-- Workaround for WFCORE-5335 issue -->
|
|
|
|
<exec osfamily="unix" dir="${auth.server.home}/bin" executable="bash" failonerror="true">
|
|
|
|
<arg value="${jboss.cli.executable}"/>
|
2019-05-17 09:22:26 +00:00
|
|
|
<arg value="--file=${cli.tmp.dir}/result.cli"/>
|
|
|
|
</exec>
|
|
|
|
<exec osfamily="windows" executable="powershell" failonerror="true">
|
|
|
|
<arg value="${auth.server.home}/bin/${jboss.cli.executable}"/>
|
2019-03-08 12:27:29 +00:00
|
|
|
<arg value="--file=${cli.tmp.dir}/result.cli"/>
|
2018-06-06 02:53:44 +00:00
|
|
|
</exec>
|
|
|
|
<cleanup/>
|
|
|
|
</target>
|
|
|
|
|
2019-05-20 20:00:26 +00:00
|
|
|
<target name="scenario-standalone-generate" depends="io-worker-threads,
|
2021-01-04 23:31:35 +00:00
|
|
|
inject-provider,
|
|
|
|
inject-truststore,
|
2019-05-20 20:00:26 +00:00
|
|
|
log-level">
|
2019-03-08 12:27:29 +00:00
|
|
|
<echo>cli scripts for standalone prepared</echo>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="scenario-cluster-generate" depends="io-worker-threads,
|
2021-01-04 23:31:35 +00:00
|
|
|
inject-provider,
|
|
|
|
inject-truststore,
|
2019-03-08 12:27:29 +00:00
|
|
|
undertow-subsystem-cluster,
|
|
|
|
ispn-cache-owners,
|
2019-05-20 20:00:26 +00:00
|
|
|
log-level">
|
2019-03-08 12:27:29 +00:00
|
|
|
<echo>cli scripts for cluster prepared</echo>
|
2019-02-18 08:19:39 +00:00
|
|
|
</target>
|
|
|
|
|
2019-03-08 12:27:29 +00:00
|
|
|
<target name="scenario-crossdc-generate" depends="io-worker-threads,
|
2021-01-04 23:31:35 +00:00
|
|
|
inject-provider,
|
|
|
|
inject-truststore,
|
2019-03-08 12:27:29 +00:00
|
|
|
cross-dc-setup,
|
2019-05-20 20:00:26 +00:00
|
|
|
log-level">
|
2019-03-08 12:27:29 +00:00
|
|
|
<echo>cli scripts for crossdc prepared</echo>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="io-worker-threads">
|
|
|
|
<copy todir="${cli.tmp.dir}">
|
|
|
|
<resources>
|
|
|
|
<file file="${common.resources}/jboss-cli/io.cli"/>
|
|
|
|
</resources>
|
|
|
|
<filterset>
|
|
|
|
<filter token="IO_WORKER_IO_THREADS" value="${auth.server.worker.io-threads}"/>
|
|
|
|
<filter token="IO_WORKER_TASK_MAX_THREADS" value="${auth.server.worker.task-max-threads}"/>
|
|
|
|
</filterset>
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
2021-01-04 23:31:35 +00:00
|
|
|
<target name="inject-provider">
|
2019-03-08 12:27:29 +00:00
|
|
|
<copy todir="${cli.tmp.dir}">
|
|
|
|
<resources>
|
|
|
|
<file file="${common.resources}/jboss-cli/keycloak-server-subsystem.cli"/>
|
|
|
|
</resources>
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
2021-01-04 23:31:35 +00:00
|
|
|
<target name="inject-truststore">
|
|
|
|
<copy todir="${cli.tmp.dir}">
|
|
|
|
<resources>
|
|
|
|
<file file="${common.resources}/jboss-cli/truststore.cli"/>
|
|
|
|
</resources>
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
2019-03-08 12:27:29 +00:00
|
|
|
<target name="set-manual-migration-strategy">
|
|
|
|
<copy todir="${cli.tmp.dir}">
|
|
|
|
<resources>
|
|
|
|
<file file="${common.resources}/jboss-cli/set-manual-migration-strategy.cli"/>
|
|
|
|
</resources>
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="configure-server-jpa" depends="update-jpa-schema">
|
2019-03-19 10:41:42 +00:00
|
|
|
<!-- I'm intentionally leaving this here. This shows up environment variables that are used during the build.
|
|
|
|
If anything goes wrong, this is the first place to look at -->
|
|
|
|
<echoproperties/>
|
2019-03-08 12:27:29 +00:00
|
|
|
<copy todir="${cli.tmp.dir}">
|
|
|
|
<resources>
|
|
|
|
<file file="${common.resources}/jboss-cli/configure-server-jpa.cli"/>
|
|
|
|
</resources>
|
|
|
|
<filterset>
|
|
|
|
<filter token="DATABASE" value="${jdbc.mvn.artifactId}"/>
|
|
|
|
<filter token="DRIVER_VERSION" value="${jdbc.mvn.version}"/>
|
|
|
|
<filter token="DRIVER_TMP_DIR" value="${jdbc.driver.tmp.dir}"/>
|
|
|
|
<filter token="JDBC_URL" value="${keycloak.connectionsJpa.url}"/>
|
|
|
|
<filter token="USER" value="${keycloak.connectionsJpa.user}"/>
|
|
|
|
<filter token="PASSWORD" value="${keycloak.connectionsJpa.password}"/>
|
|
|
|
</filterset>
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="update-jpa-schema" if="update.schema" depends="schema-update-required">
|
|
|
|
<copy todir="${cli.tmp.dir}">
|
|
|
|
<resources>
|
|
|
|
<file file="${common.resources}/jboss-cli/update-jpa-schema.cli"/>
|
|
|
|
</resources>
|
|
|
|
<filterset>
|
|
|
|
<filter token="SCHEMA" value="${keycloak.connectionsJpa.schema}"/>
|
|
|
|
</filterset>
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="schema-update-required">
|
|
|
|
<condition property="update.schema">
|
|
|
|
<not>
|
|
|
|
<equals arg1="${keycloak.connectionsJpa.schema}" arg2="DEFAULT"/>
|
|
|
|
</not>
|
|
|
|
</condition>
|
|
|
|
<echo>Updating schema?: ${update.schema}</echo>
|
|
|
|
<echo>keycloak.connectionsJpa.schema: ${keycloak.connectionsJpa.schema}</echo>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="undertow-subsystem-cluster">
|
|
|
|
<copy todir="${cli.tmp.dir}">
|
|
|
|
<resources>
|
|
|
|
<file file="${common.resources}/jboss-cli/undertow-subsystem-cluster-setup.cli"/>
|
|
|
|
</resources>
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="ispn-cache-owners">
|
|
|
|
<copy todir="${cli.tmp.dir}">
|
|
|
|
<resources>
|
|
|
|
<file file="${common.resources}/jboss-cli/ispn-cache-owners.cli"/>
|
|
|
|
</resources>
|
|
|
|
<filterset>
|
|
|
|
<filter token="SESSION_CACHE_OWNERS" value="${session.cache.owners}"/>
|
|
|
|
<filter token="OFFLINE_SESSION_CACHE_OWNERS" value="${offline.session.cache.owners}"/>
|
|
|
|
<filter token="LOGIN_FAILURE_CACHE_OWNERS" value="${login.failure.cache.owners}"/>
|
|
|
|
</filterset>
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
2019-05-20 20:00:26 +00:00
|
|
|
<target name="log-level" if="set.log.level" depends="log-level-update-required">
|
2019-03-08 12:27:29 +00:00
|
|
|
<copy todir="${cli.tmp.dir}">
|
|
|
|
<resources>
|
2019-05-20 20:00:26 +00:00
|
|
|
<file file="${common.resources}/jboss-cli/add-log-level.cli"/>
|
2019-03-08 12:27:29 +00:00
|
|
|
</resources>
|
|
|
|
<filterset>
|
|
|
|
<filter token="INFINISPAN_LOG_LEVEL" value="${infinispan.log.level}"/>
|
2019-05-20 20:00:26 +00:00
|
|
|
<filter token="SCHEDULED_TASKS_LOG_LEVEL" value="${scheduled.tasks.log.level}"/>
|
2019-03-08 12:27:29 +00:00
|
|
|
</filterset>
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
2019-05-20 20:00:26 +00:00
|
|
|
<target name="log-level-update-required">
|
|
|
|
<!-- Default log levels -->
|
|
|
|
<property name="infinispan.log.level" value="INFO"/>
|
|
|
|
<property name="scheduled.tasks.log.level" value="INFO"/>
|
|
|
|
|
|
|
|
<condition property="set.log.level">
|
2019-03-08 12:27:29 +00:00
|
|
|
<or>
|
|
|
|
<equals arg1="${infinispan.log.level}" arg2="DEBUG"/>
|
|
|
|
<equals arg1="${infinispan.log.level}" arg2="TRACE"/>
|
2019-05-20 20:00:26 +00:00
|
|
|
<equals arg1="${scheduled.tasks.log.level}" arg2="DEBUG"/>
|
|
|
|
<equals arg1="${scheduled.tasks.log.level}" arg2="TRACE"/>
|
2019-03-08 12:27:29 +00:00
|
|
|
</or>
|
|
|
|
</condition>
|
2019-05-20 20:00:26 +00:00
|
|
|
<echo>Updating log level?: ${set.log.level}</echo>
|
2019-03-08 12:27:29 +00:00
|
|
|
<echo>infinispan.log.level: ${infinispan.log.level}</echo>
|
2019-05-20 20:00:26 +00:00
|
|
|
<echo>sheduled.tasks.log.level: ${scheduled.tasks.log.level}</echo>
|
2019-03-08 12:27:29 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="replace-jdbc-url">
|
|
|
|
<copy todir="${cli.tmp.dir}">
|
|
|
|
<resources>
|
|
|
|
<file file="${common.resources}/jboss-cli/replace-jdbc-url.cli"/>
|
|
|
|
</resources>
|
|
|
|
<filterset>
|
|
|
|
<filter token="JDBC_URL" value="${h2.jdbc.url}"/>
|
|
|
|
</filterset>
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="cross-dc-setup">
|
|
|
|
<copy todir="${cli.tmp.dir}">
|
|
|
|
<resources>
|
|
|
|
<file file="${common.resources}/jboss-cli/cross-dc-setup.cli"/>
|
|
|
|
</resources>
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!--following target is used by testsuite/integration-arquillian/servers/migration-->
|
|
|
|
<target name="configure-server-jpa-legacy">
|
|
|
|
<copy todir="${cli.tmp.dir}">
|
|
|
|
<resources>
|
|
|
|
<file file="${common.resources}/jboss-cli/migration/configure-server-jpa-legacy.cli"/>
|
|
|
|
</resources>
|
|
|
|
<filterset>
|
|
|
|
<filter token="DATABASE" value="${jdbc.mvn.artifactId}"/>
|
2020-03-03 15:51:20 +00:00
|
|
|
<filter token="DRIVER_VERSION" value="${jdbc.mvn.version}"/>
|
2019-03-08 12:27:29 +00:00
|
|
|
<filter token="DRIVER_TMP_DIR" value="${jdbc.driver.tmp.dir}"/>
|
|
|
|
<filter token="JDBC_URL" value="${keycloak.connectionsJpa.url}"/>
|
|
|
|
<filter token="USER" value="${keycloak.connectionsJpa.user}"/>
|
|
|
|
<filter token="PASSWORD" value="${keycloak.connectionsJpa.password}"/>
|
|
|
|
</filterset>
|
|
|
|
</copy>
|
|
|
|
</target>
|
2018-06-06 02:53:44 +00:00
|
|
|
</project>
|