SSH Upload
The SSH Upload build runner allows uploading files/directories via SSH (using SCP or SFTP protocols).
The settings common for all runners are described in Configuring Build Steps; this page details the SSH Deployer settings.
The fields below support parameter references: any text between percentage signs (%
) is considered a reference to a property by TeamCity. To prevent TeamCity from treating the text in the percentage signs as reference to a property, use two percentage signs to escape them: for example, if you want to pass %Y%m%d%H%M%S
into the build, change it to %%Y%%m%%d%%H%%M%%S
.
Option | Description |
---|---|
Step name | Optional Name of the build step displayed in the TeamCity UI. |
Step ID | ID for this build step, which must be unique across all steps of this configuration. Used in URLs, REST API, DSL, HTTP requests to the server, and configuration settings in the TeamCity Data Directory. |
Execute step | Enables you to modify the default build condition, and optionally add more build conditions. |
Deployment Target | |
Target | SSH server location where the files will be uploaded, specified in the format:
{hostname|IP_address}[:targer_dir[/sub_path]]
where |
Transport protocol | Select a protocol to transfer data over SSH. The available options are: SCP and SFTP |
Port | Optional Port. Defaults to port 22. |
Timeout | Optional Timeout for the connection in seconds. Defaults to 0. |
Deployment Credentials | |
Authentication method | Select an authentication method:
|
Deployment Source | |
Paths to sources | Specify the deployment sources as a newline- or comma-separated list of paths to files/directories. The field supports Ant-style wildcard patterns (for example, |
Example
For example, consider the case where you need to add an SSH Upload build step to upload Java packages to an SSH server (on the ssh.example.com
host). Suppose you use the jdoe
account on the SSH server with the home directory /jdoe
, and the SSH server is configured to use SSH keys for authentication.
Follow the steps in Generated SSH Keys to generate a new SSH key pair in your project. Call the key pair
PackageUploadKey
.Copy the public key from the
PackageUploadKey
key pair.Log in to the
jdoe
account on your SSH server and follow the instructions from your SSH server provider to add thePackageUploadKey
public key to this account.In your project's build configuration, go to the Build Steps page and click Add build step.
On the New Build Step page, select the SSH Upload runner.
On the New Build Step: SSH Upload page, fill in the fields, as follows:
Step name — Enter
UploadJavaPackages
Target — Enter
ssh.example.com:/jdoe
Authentication method — Select Uploaded key
Username — Enter
jdoe
(the username for the account on the SSH server)Select key — Select
PackageUploadKey
from the dropdown listPaths to sources — Enter the following paths:
ch-simple/simple/target/*.jar => packages
Click Save to create the build step.