title | description | ms.date | monikerRange |
---|---|---|---|
CopyFilesOverSSH@0 - Copy files over SSH v0 task |
Copy files or build artifacts to a remote machine over SSH. |
01/29/2025 |
<=azure-pipelines |
:::moniker range="<=azure-pipelines"
Copy files or build artifacts to a remote machine over SSH.
:::moniker-end
:::moniker range="=azure-pipelines"
# Copy files over SSH v0
# Copy files or build artifacts to a remote machine over SSH.
- task: CopyFilesOverSSH@0
inputs:
sshEndpoint: # string. Required. SSH service connection.
#sourceFolder: # string. Source folder.
contents: '**' # string. Required. Contents. Default: **.
#targetFolder: # string. Target folder.
# Advanced
#isWindowsOnTarget: false # boolean. Target machine running Windows. Default: false.
#cleanTargetFolder: false # boolean. Clean target folder. Default: false.
#cleanHiddenFilesInTarget: false # boolean. Optional. Use when cleanTargetFolder = true. Remove hidden files in target folder. Default: false.
readyTimeout: '20000' # string. Required. SSH handshake timeout. Default: 20000.
#overwrite: true # boolean. Overwrite. Default: true.
#failOnEmptySource: false # boolean. Fail if no files found to copy. Default: false.
#flattenFolders: false # boolean. Flatten folders. Default: false.
#concurrentUploads: '10' # string. Number of concurrent uploads when copying files. Default: 10.
#delayBetweenUploads: '50' # string. Delay between queueing uploads (in milliseconds). Default: 50.
:::moniker-end
:::moniker range=">=azure-pipelines-2022 <=azure-pipelines-2022.2"
# Copy files over SSH v0
# Copy files or build artifacts to a remote machine over SSH.
- task: CopyFilesOverSSH@0
inputs:
sshEndpoint: # string. Required. SSH service connection.
#sourceFolder: # string. Source folder.
contents: '**' # string. Required. Contents. Default: **.
#targetFolder: # string. Target folder.
# Advanced
#isWindowsOnTarget: false # boolean. Target machine running Windows. Default: false.
#cleanTargetFolder: false # boolean. Clean target folder. Default: false.
#cleanHiddenFilesInTarget: false # boolean. Optional. Use when cleanTargetFolder = true. Remove hidden files in target folder. Default: false.
readyTimeout: '20000' # string. Required. SSH handshake timeout. Default: 20000.
#overwrite: true # boolean. Overwrite. Default: true.
#failOnEmptySource: false # boolean. Fail if no files found to copy. Default: false.
#flattenFolders: false # boolean. Flatten folders. Default: false.
:::moniker-end
:::moniker range=">=azure-pipelines-2020 <=azure-pipelines-2020.1"
# Copy files over SSH v0
# Copy files or build artifacts to a remote machine over SSH.
- task: CopyFilesOverSSH@0
inputs:
sshEndpoint: # string. Required. SSH service connection.
#sourceFolder: # string. Source folder.
contents: '**' # string. Required. Contents. Default: **.
#targetFolder: # string. Target folder.
# Advanced
#isWindowsOnTarget: false # boolean. Target machine running Windows. Default: false.
#cleanTargetFolder: false # boolean. Clean target folder. Default: false.
readyTimeout: '20000' # string. Required. SSH handshake timeout. Default: 20000.
#overwrite: true # boolean. Overwrite. Default: true.
#failOnEmptySource: false # boolean. Fail if no files found to copy. Default: false.
#flattenFolders: false # boolean. Flatten folders. Default: false.
:::moniker-end
:::moniker range="=azure-pipelines-2019.1"
# Copy files over SSH v0
# Copy files or build artifacts to a remote machine over SSH.
- task: CopyFilesOverSSH@0
inputs:
sshEndpoint: # string. Required. SSH service connection.
#sourceFolder: # string. Source folder.
contents: '**' # string. Required. Contents. Default: **.
#targetFolder: # string. Target folder.
# Advanced
#cleanTargetFolder: false # boolean. Clean target folder. Default: false.
#overwrite: true # boolean. Overwrite. Default: true.
#failOnEmptySource: false # boolean. Fail if no files found to copy. Default: false.
#flattenFolders: false # boolean. Flatten folders. Default: false.
:::moniker-end
:::moniker range="=azure-pipelines-2019"
# Copy Files Over SSH v0
# Copy files or build artifacts to a remote machine over SSH.
- task: CopyFilesOverSSH@0
inputs:
sshEndpoint: # string. Required. SSH service connection.
#sourceFolder: # string. Source folder.
contents: '**' # string. Required. Contents. Default: **.
#targetFolder: # string. Target folder.
# Advanced
#cleanTargetFolder: false # boolean. Clean target folder. Default: false.
#overwrite: true # boolean. Overwrite. Default: true.
#failOnEmptySource: false # boolean. Fail if no files found to copy. Default: false.
#flattenFolders: false # boolean. Flatten folders. Default: false.
:::moniker-end
:::moniker range=">=azure-pipelines-2019"
sshEndpoint
- SSH service connection
string
. Required.
The name of an SSH service connection 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 service connection.
- The private key and the passphrase must be specified for authentication.
:::moniker-end
:::moniker range="<=azure-pipelines"
sourceFolder
- Source folder
string
.
The source folder of the files to copy to the remote machine. When empty, the root of the repository (build) or artifacts directory (release) is used, which is $(System.DefaultWorkingDirectory)
. Use variables if files are not in the repository. Example: $(Agent.BuildDirectory)
.
:::moniker-end
:::moniker range="<=azure-pipelines"
contents
- Contents
string
. Required. Default value: **
.
The file paths to include as part of the copy. Supports multiple lines of minimatch patterns. The default value is **
, which includes all files (including sub-folders) under the source folder.
- Example:
**/*.*(jar|war)
includes all .jar and .war files (including sub-folders) under the source folder. - Example:
"** \n !**/*.xml"
includes all files (including sub-folders) under the source folder, but excludes xml files.
:::moniker-end
:::moniker range="<=azure-pipelines"
targetFolder
- Target folder
string
.
The target folder on the remote machine, where files will be copied. Example: /home/user/MySite
. Preface with a tilde (~)
to specify the user's home directory.
:::moniker-end
:::moniker range=">=azure-pipelines-2020"
isWindowsOnTarget
- Target machine running Windows
boolean
. Default value: false
.
Checks if the target machine is running Windows.
:::moniker-end
:::moniker range="<=azure-pipelines"
cleanTargetFolder
- Clean target folder
boolean
. Default value: false
.
Deletes all existing files and sub-folders in the target folder before copying.
:::moniker-end
:::moniker range=">=azure-pipelines-2022"
cleanHiddenFilesInTarget
- Remove hidden files in target folder
boolean
. Optional. Use when cleanTargetFolder = true
. Default value: false
.
When set to true
, removes hidden files in the target folder.
:::moniker-end
:::moniker range=">=azure-pipelines-2020"
readyTimeout
- SSH handshake timeout
string
. Required. Default value: 20000
.
How long (in milliseconds) to wait for the SSH handshake to complete.
:::moniker-end
:::moniker range="<=azure-pipelines"
overwrite
- Overwrite
boolean
. Default value: true
.
Replaces existing files in and beneath the target folder.
:::moniker-end
:::moniker range="<=azure-pipelines"
failOnEmptySource
- Fail if no files found to copy
boolean
. Default value: false
.
Fails if no matching files to be copied are found under the source folder.
:::moniker-end
:::moniker range="<=azure-pipelines"
flattenFolders
- Flatten folders
boolean
. Default value: false
.
Flattens the folder structure and copies all files into the specified target folder on the remote machine.
:::moniker-end
:::moniker range="=azure-pipelines"
concurrentUploads
- Number of concurrent uploads when copying files
string
. Default value: 10
.
Number of concurrent uploads when copying files. Default is 10.
:::moniker-end
:::moniker range="=azure-pipelines"
delayBetweenUploads
- Delay between queueing uploads (in milliseconds)
string
. Default value: 50
.
Delay between queueing uploads (in milliseconds). Default is 50.
:::moniker-end
All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.
:::moniker range="<=azure-pipelines"
None.
:::moniker-end
:::moniker range="=azure-pipelines"
Requirement | Description |
---|---|
Pipeline types | YAML, Classic build, Classic release |
Runs on | Agent, DeploymentGroup |
Demands | None |
Capabilities | This task does not satisfy any demands for subsequent tasks in the job. |
Command restrictions | This task runs using the following command restrictions: restricted |
Settable variables | This task has permission to set the following variables: Setting variables is disabled |
Agent version | 2.206.1 or greater |
Task category | Deploy |
:::moniker-end
:::moniker range=">=azure-pipelines-2022 <=azure-pipelines-2022.2"
Requirement | Description |
---|---|
Pipeline types | YAML, Classic build, Classic release |
Runs on | Agent, DeploymentGroup |
Demands | None |
Capabilities | This task does not satisfy any demands for subsequent tasks in the job. |
Command restrictions | This task runs using the following command restrictions: restricted |
Settable variables | This task has permission to set the following variables: Setting variables is disabled |
Agent version | 2.182.1 or greater |
Task category | Deploy |
:::moniker-end
:::moniker range="=azure-pipelines-2020.1"
Requirement | Description |
---|---|
Pipeline types | YAML, Classic build, Classic release |
Runs on | Agent, DeploymentGroup |
Demands | None |
Capabilities | This task does not satisfy any demands for subsequent tasks in the job. |
Command restrictions | Any |
Settable variables | Any |
Agent version | 2.144.0 or greater |
Task category | Deploy |
:::moniker-end
:::moniker range="<=azure-pipelines-2020"
Requirement | Description |
---|---|
Pipeline types | YAML, Classic build, Classic release |
Runs on | Agent, DeploymentGroup |
Demands | None |
Capabilities | This task does not satisfy any demands for subsequent tasks in the job. |
Command restrictions | Any |
Settable variables | Any |
Agent version | 2.102.0 or greater |
Task category | Deploy |
:::moniker-end