awips2/build/deploy.edex.awips2/deploy/deploy-esb.xml

114 lines
4.1 KiB
XML
Raw Normal View History

2022-05-05 12:34:50 -05:00
<project name="deploy.esb" default="main">
<!-- <import file="deploy-web.xml" /> -->
<target name="main">
<!-- on a developer machine, the following directories should
already exist. -->
<mkdir dir="${edex.root.directory}/lib" />
<mkdir dir="${edex.root.directory}/bin" />
<mkdir dir="${edex.root.directory}/conf" />
<antcall target="cleanup" />
<!-- Determine if any Work Assignments have been specified. -->
<condition property="wa.enabled">
<not><equals arg1="${wa.to.deploy}" arg2="" /></not>
</condition>
<antcall target="deploy.esb" />
<if>
<equals arg1="${deploy.data}" arg2="true" />
<then>
<antcall target="deploy.esb-data" />
</then>
</if>
<for list="${wa.specific.deploy}" param="wa" delimiter="${path.separator}">
<sequential>
<basename property="wa.name" file="@{wa}" />
<var name="wa.base.directory"
value="${git.directory}/@{wa}/edex/deploy.edex-${wa.name}" />
<if>
<available file="${wa.base.directory}/esb"
type="dir" />
<then>
<copy todir="${edex.root.directory}"
overwrite="${esb.overwrite}" failonerror="true">
<fileset dir="${wa.base.directory}/esb"/>
</copy>
</then>
</if>
</sequential>
</for>
</target>
<target name="cleanup">
<!-- delete all files under ${esbDir}/lib/ -->
<echo message="Cleaning target directory: ${edex.root.directory}/lib/" />
<delete includeemptydirs="true">
<fileset dir="${edex.root.directory}/lib/">
<exclude name="native/**" />
</fileset>
</delete>
<!-- delete the shell scripts from ${esbDir}/bin/ -->
<echo message="Cleaning target directory: ${edex.root.directory}/bin/" />
<delete includeemptydirs="true">
<fileset dir="${edex.root.directory}/bin/">
<include name="*.sh"/>
<include name="yajsw/**" />
</fileset>
</delete>
<echo message="Cleaning target directory: ${edex.root.directory}/conf" />
<delete>
<fileset dir="${edex.root.directory}/conf">
<exclude name="**/site/**"/>
<exclude name="**/auth/**"/>
</fileset>
</delete>
</target>
<target name="deploy.esb">
<copy todir="${edex.root.directory}"
overwrite="${esb.overwrite}">
<fileset dir="${esb.directory}">
<exclude name="data/**" />
<exclude name="svcBackup/**" />
<exclude name="**/bin/setup.env" />
<exclude name="**/bin/linux-x86-32/**" />
<exclude name="**/bin/linux-x86-64/**" />
</fileset>
</copy>
<!-- set executable permissions - start.sh. -->
<chmod file="${edex.root.directory}/bin/start.sh" perm="ugo+rx" />
<!-- set executable permissions - private keys -->
<chmod file="${edex.root.directory}/conf/db/auth/*.key" perm="go-rwx" />
<chmod file="${edex.root.directory}/conf/db/auth/*.pk8" perm="go-rwx" />
</target>
<target name="deploy.esb-data">
<copy todir="${edex.root.directory}"
overwrite="${esb.overwrite}">
<fileset dir="${esb.directory}" includes="data/**" />
</copy>
<!-- update directory permissions. -->
<exec executable="chmod">
<arg value="-R"/>
<arg value="775"/>
<arg value="${edex.root.directory}/data"/>
</exec>
</target>
<path id="ant.contrib.path">
<fileset dir="/awips2/ant/lib/">
<include name="ant-contrib-*.jar" />
</fileset>
</path>
<taskdef resource="net/sf/antcontrib/antlib.xml"
classpathref="ant.contrib.path" />
</project>