Deploy: Copy Files Over SSH
VSTS | TFS 2018 | TFS 2017
Copy files from source folder to target folder on a remote machine over SSH.
This task allows you to connect to a remote machine using SSH and copy files matching a set of minimatch patterns from specified source folder to target folder on the remote machine. Supported protocols for file transfer are SFTP and SCP via SFTP.
- The task supports use of an SSH key pair to connect to the remote machine(s).
- The public key must be pre-installed or copied to the remote machine(s).
|SSH endpoint||The name of an SSH service endpoint containing connection details for the remote machine.
- The hostname or IP address of the remote machine, the port number, and the user name are required to create an SSH endpoint.
- The private key and the passphrase must be specified for authentication.
- A password can be used to authenticate to remote Linux machines, but this is not supported for macOS or Windows systems.
|Source folder||The source folder for the files to copy to the remote machine. If omitted, the root of the repository is used. Names containing wildcards such as
|Contents||File paths to include as part of the copy. Supports multiple lines of minimatch patterns. Default is
|Target folder||Target folder on the remote machine to where files will be copied. Example:
|Advanced - Clean target folder||If this option is selected, all existing files in the target folder will be deleted before copying.|
|Advanced - Overwrite||If this option is selected (the default), existing files in the target folder will be replaced.|
|Advanced - Flatten folders||If this option is selected, the folder structure is not preserved and all the files will be copied into the specified target folder on the remote machine.|
|Control options||See Control options|
- task: CopyFilesOverSSH@0 inputs: sshEndpoint: sourceFolder: # contents: ** targetFolder: # cleanTargetFolder: false # overwrite: true # failOnEmptySource: false # flattenFolders: false
Do I need an agent?
You need at least one agent to run your build or release. Get an agent.