<commit_before><?xml version="1.0"?>

<!-- Works with Ant 1.7.0 and higher -->
<project basedir=".">

    <macrodef name="deploy-war-on-tomcat-server">
        <attribute name="applicationName" default="${TOMCAT.APPLICATION.NAME}" />
        <attribute name="warFile" default="${WAR-FILE}" />
        <sequential>
            <undeploy-war-on-tomcat-server applicationName="@{applicationName}" warFile="@{warFile}" />
            <if>
                <os family="unix" />
                <then>
                    <exec executable="curl" output="${LOG.DIR}/war_deploy.log">
                        <arg value="--upload-file @{warFile} http://${TOMCAT.USERNAME}:${TOMCAT.PASSWORD}@${TOMCAT.SERVER.ADDRESS}:${TOMCAT.SERVER.PORT}/manager/text/deploy?path=/@{applicationName}"/>
                    </exec>
                </then>
                <else>
                    <get quiet="false" src="http://${TOMCAT.SERVER.ADDRESS}:${TOMCAT.SERVER.PORT}/manager/text/deploy?path=/@{applicationName}&amp;war=@{warFile}" username="${TOMCAT.USERNAME}" password="${<PASSWORD>}" dest="${LOG.DIR}/war_deploy.log" verbose="true"/>
                </else>
            </if>

            <loadfile property="war_deploy_log" srcfile="${LOG.DIR}/war_deploy.log"/>
            <condition property="war_deploy.success">
                <matches pattern="OK.*" string="${war_deploy_log}"/>
            </condition>

            <fail message="War deployment failed" unless="war_deploy.success" />
        </sequential>
    </macrodef>

    <macrodef name="undeploy-war-on-tomcat-server">
        <attribute name="applicationName" default="${TOMCAT.APPLICATION.NAME}" />
        <attribute name="warFile" default="${WAR-FILE}" />
        <sequential>
            <get quiet="false" src="http://${TOMCAT.SERVER.ADDRESS}:${TOMCAT.SERVER.PORT}/manager/text/undeploy?path=/@{applicationName}" username="${TOMCAT.USERNAME}" password="${<PASSWORD>}" dest="${LOG.DIR}/war_undeploy.log" verbose="true"/><commit_msg>Curl test<commit_after><?xml version="1.0"?>

<!-- Works with Ant 1.7.0 and higher -->
<project basedir=".">

    <macrodef name="deploy-war-on-tomcat-server">
        <attribute name="applicationName" default="${TOMCAT.APPLICATION.NAME}" />
        <attribute name="warFile" default="${WAR-FILE}" />
        <sequential>
            <undeploy-war-on-tomcat-server applicationName="@{applicationName}" warFile="@{warFile}" />
            <if>
                <os family="unix" />
                <then>
                    <exec executable="curl" output="${LOG.DIR}/war_deploy.log">
                        <arg line="--upload-file @{warFile} http://${TOMCAT.USERNAME}:${TOMCAT.PASSWORD}@${TOMCAT.SERVER.ADDRESS}:${TOMCAT.SERVER.PORT}/manager/text/deploy?path=/@{applicationName}"/>
                    </exec>
                </then>
                <else>
                    <get quiet="false" src="http://${TOMCAT.SERVER.ADDRESS}:${TOMCAT.SERVER.PORT}/manager/text/deploy?path=/@{applicationName}&amp;war=@{warFile}" username="${TOMCAT.USERNAME}" password="${<PASSWORD>}" dest="${LOG.DIR}/war_deploy.log" verbose="true"/>
                </else>
            </if>

            <loadfile property="war_deploy_log" srcfile="${LOG.DIR}/war_deploy.log"/>
            <condition property="war_deploy.success">
                <matches pattern="OK.*" string="${war_deploy_log}"/>
            </condition>

            <fail message="War deployment failed" unless="war_deploy.success" />
        </sequential>
    </macrodef>

    <macrodef name="undeploy-war-on-tomcat-server">
        <attribute name="applicationName" default="${TOMCAT.APPLICATION.NAME}" />
        <attribute name="warFile" default="${WAR-FILE}" />
        <sequential>
            <get quiet="false" src="http://${TOMCAT.SERVER.ADDRESS}:${TOMCAT.SERVER.PORT}/manager/text/undeploy?path=/@{applicationName}" username="${TOMCAT.USERNAME}" password="${<PASSWORD>}" dest="${LOG.DIR}/war_undeploy.log" verbose="true"/>
{'fraction_non_alphanumeric': 0.1924918115394306, 'fraction_numerical': 0.0025195263290501385, 'mean_word_length': 2.731203007518797, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 2, '>': 69, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2337680', 'n_tokens_mistral': 1217, 'n_tokens_neox': 1146, 'n_words': 154}