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

<!--
  ~ Copyright 2000-2022 JetBrains s.r.o.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->


<dsl-extension kind="buildStep" type="ssh-deploy-runner" generateDslJar="true">
    <class name="SSHUpload">
        <description>
            An SSH Upload build step.
        </description>
    </class>
    <function name="sshUpload">
        <description>
            Adds an SSH Upload build step.
            @see SSHUpload
        </description>
    </function>
    <params>

        <param name="jetbrains.buildServer.deployer.ssh.transport" dslName="transportProtocol" type="TransportProtocol" mandatory="true">
            <description>
                An SSH transfer protocol to use.
            </description>
        </param>

        <param name="jetbrains.buildServer.deployer.sourcePath" dslName="sourcePath" mandatory="true">
            <description>
                Newline- or comma-separated paths to files/directories to be deployed.
                Ant-style wildcards like dir/**/*.zip and target directories like
                *.zip => winFiles,unix/distro.tgz => linuxFiles,
                where winFiles and linuxFiles are target directories, are supported.
            </description>
        </param>
    </params>
    <types>
        <enum name="TransportProtocol">
            <option name="SFTP" value="jetbrains.buildServer.deployer.ssh.transport.sftp"/>
            <option name="SCP" value="jetbrains.buildServer.deployer.ssh.transport.scp"/>
        </enum>
    </types>
</dsl-extension><commit_msg>Add DSL examples for SSH Upload build step<commit_after><?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ Copyright 2000-2022 JetBrains s.r.o.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->


<dsl-extension kind="buildStep" type="ssh-deploy-runner" generateDslJar="true">
    <class name="SSHUpload">
        <description>
            An SSH Upload build step.
        </description>
    </class>
    <function name="sshUpload">
        <description>
            Adds an SSH Upload build step.
            @see SSHUpload
        </description>
    </function>
    <params>

        <param name="jetbrains.buildServer.deployer.ssh.transport" dslName="transportProtocol" type="TransportProtocol" mandatory="true">
            <description>
                An SSH transfer protocol to use.
            </description>
        </param>

        <param name="jetbrains.buildServer.deployer.sourcePath" dslName="sourcePath" mandatory="true">
            <description>
                Newline- or comma-separated paths to files/directories to be deployed.
                Ant-style wildcards like dir/**/*.zip and target directories like
                *.zip => winFiles,unix/distro.tgz => linuxFiles,
                where winFiles and linuxFiles are target directories, are supported.
            </description>
        </param>
    </params>
    <types>
        <enum name="TransportProtocol">
            <option name="SFTP" value="jetbrains.buildServer.deployer.ssh.transport.sftp"/>
            <option name="SCP" value="jetbrains.buildServer.deployer.ssh.transport.scp"/>
        </enum>
    </types>

    <examples>
        <example>
            <description>
                Adds an SSH Upload build step with
                SCP transport protocol
                and custom timeout.
                [Uploaded key authentication method](https://www.jetbrains.com/help/teamcity/?SSH+Upload) is used.
            </description>
            <code>
                sshUpload {
                    name = "My SSH Upload build step"
                    transportProtocol = SSHUpload.TransportProtocol.SCP
                    sourcePath = """
                        dir/**/*.zip
                        *.zip => winFiles
                        unix/distro.tgz => linuxFiles
                    """.trimIndent()
                    targetUrl = "hostname:path/to/target/folder"
                    timeout = 30
                    authMethod = uploadedKey {
                        username = "username"
                        passphrase = "<PASSWORD>:******"
                        key = "id_rsa"
                    }
                }
            </code>
        </example>
        <example>
            <description>
                Adds an SSH Upload build step with
                SFTP transport protocol, custom port and disabled timeout.
                [Default private key authentication method](https://www.jetbrains.com/help/teamcity/?SSH+Upload) is used.
            </description>
            <code>
                sshUpload {
                    name = "My SSH Upload build step"
                    transportProtocol = SSHUpload.TransportProtocol.SFTP
                    sourcePath = """
                        dir/**/*.zip
                        *.zip => winFiles
                        unix/distro.tgz => linuxFiles
                    """.trimIndent()
                    targetUrl = "hostname:path/to/target/folder"
                    port = 2222
                    timeout = 0
                    authMethod = defaultPrivateKey {
                        username = "username"
                        passphrase = "<PASSWORD>:******"
                    }
                }
            </code>
        </example>
        <example>
            <description>
                Adds an SSH Upload build step with
                SFTP transport protocol.
                [Custom private key authentication method](https://www.jetbrains.com/help/teamcity/?SSH+Upload) is used.
            </description>
            <code>
                sshUpload {
                    name = "My SSH Upload build step"
                    transportProtocol = SSHUpload.TransportProtocol.SFTP
                    sourcePath = """
                        dir/**/*.zip
                        *.zip => winFiles
                        unix/distro.tgz => linuxFiles
                    """.trimIndent()
                    targetUrl = "hostname:path/to/target/folder"
                    authMethod = customPrivateKey {
                        keyFile = "path/to/key/file"
                        username = "username"
                        passphrase = "<PASSWORD>:******"
                    }
                }
            </code>
        </example>
        <example>
            <description>
                Adds an SSH Upload build step with
                SCP transport protocol.
                [Password authentication method](https://www.jetbrains.com/help/teamcity/?SSH+Upload) is used.
            </description>
            <code>
                sshUpload {
                    name = "My SSH Upload build step"
                    transportProtocol = SSHUpload.TransportProtocol.SCP
                    sourcePath = """
                        dir/**/*.zip
                        *.zip => winFiles
                        unix/distro.tgz => linuxFiles
                    """.trimIndent()
                    targetUrl = "hostname:path/to/target/folder"
                    authMethod = password {
                        username = "username"
                        password = "<PASSWORD>:******"
                    }
                }
            </code>
        </example>
        <example>
            <description>
                Adds an SSH Upload build step with
                SCP transport protocol.
                [SSH-Agent authentication method](https://www.jetbrains.com/help/teamcity/?SSH+Upload) is used.
                This build step will run even if some previous build steps are failed and additional condition is met.
            </description>
            <code>
                sshUpload {
                    name = "My SSH Upload build step"

                    executionMode = BuildStep.ExecutionMode.RUN_ON_FAILURE
                    conditions {
                        equals("teamcity.build.branch", "release")
                    }

                    transportProtocol = SSHUpload.TransportProtocol.SCP
                    sourcePath = """
                        dir/**/*.zip
                        *.zip => winFiles
                        unix/distro.tgz => linuxFiles
                    """.trimIndent()
                    targetUrl = "hostname:path/to/target/folder"
                    authMethod = sshAgent {
                        username = "username"
                    }
                }
            </code>
        </example>
    </examples>
</dsl-extension>
{'fraction_non_alphanumeric': 0.09590472210614291, 'fraction_numerical': 0.003865440869201839, 'mean_word_length': 1.447711582715418, 'pattern_counts': {'":': 0, '<': 95, '<?xml version=': 2, '>': 109, 'https://': 5, 'lorem ipsum': 0, 'www.': 7, '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': '5971585', 'n_tokens_mistral': 2455, 'n_tokens_neox': 2227, 'n_words': 629}