<?xml version="1.0" encoding="UTF-8"?>




<dsl-extension kind="buildStep" type="cargo-deploy-runner" generateDslJar="true">
    <class name="ContainerDeployer">
        <description>
            A Container Deployer build step.
        </description>
    </class>
    <function name="containerDeployer">
        <description>
            Adds a Container Deployer build step.
            @see ContainerDeployer
        </description>
    </function>
    <params>
        <param name="jetbrains.buildServer.deployer.targetUrl" dslName="targetUrl" mandatory="true">
            <description>
                Target container info. Use format: {hostname|IP}[:port].
            </description>
        </param>

        <param name="jetbrains.buildServer.deployer.container.type" dslName="containerType" type="ContainerType" mandatory="true">
            <description>
                Default "Manager" web app must be deployed to target Tomcat.
                User must have role "manager-script".
            </description>
        </param>

        <param name="jetbrains.buildServer.deployer.cargo.https" dslName="useHTTPS" type="boolean" trueValue="true" falseValue="">
            <description>
                Use HTTPS protocol.
            </description>
        </param>

        <param name="jetbrains.buildServer.deployer.username" dslName="username" mandatory="true">
            Username. The user must have "manager-script" role assigned.
        </param>

        <param name="secure:jetbrains.buildServer.deployer.password" dslName="password" mandatory="true"/>

        <param name="jetbrains.buildServer.deployer.sourcePath" dslName="sourcePath" mandatory="true">
            <description>
                Path to WAR archive to deploy.
            </description>
        </param>
    </params>
    <types>
        <enum name="ContainerType">
            <option name="TOMCAT_8_X" value="tomcat8x"/>
            <option name="TOMCAT_7_X" value="tomcat7x"/>
            <option name="TOMCAT_6_X" value="tomcat6x"/>
            <option name="TOMCAT_5_X" value="tomcat5x"/>
        </enum>
    </types>

    <examples>
        <example>
            <description>
                Adds a Container Deployer with HTTPS enabled.
            </description>
            <code>
                containerDeployer {
                    name = "My Container Deployer build step"
                    targetUrl = "{hostname|IP}[:port]"
                    containerType = ContainerDeployer.ContainerType.TOMCAT_8_X
                    useHTTPS = true
                    username = "username"
                    password = "credentialsJSON:******"
                    sourcePath = "path/to/war"
                }
            </code>
        </example>
    </examples>
</dsl-extension>