Skip to content

Latest commit

 

History

History
316 lines (251 loc) · 12.2 KB

ftp-upload-v1.md

File metadata and controls

316 lines (251 loc) · 12.2 KB
title description ms.date monikerRange
FtpUpload@1 - FTP upload v1 task
Upload files using FTP (task version 1).
07/02/2024
<=azure-pipelines

FtpUpload@1 - FTP upload v1 task

:::moniker range="<=azure-pipelines"

Use this task to upload files to a remote machine using FTP or securely with FTPS.

:::moniker-end

Syntax

:::moniker range=">=azure-pipelines-2019.1"

# FTP upload v1
# Upload files using FTP.
- task: FtpUpload@1
  inputs:
    credentialsOption: 'serviceEndpoint' # 'serviceEndpoint' | 'inputs'. Alias: credsType. Required. Authentication Method. Default: serviceEndpoint.
    serverEndpoint: # string. Required when credsType = serviceEndpoint. FTP Service Connection. 
    #serverUrl: # string. Required when credsType = inputs. Server URL. 
    #username: # string. Required when credsType = inputs. Username. 
    #password: # string. Required when credsType = inputs. Password. 
    rootDirectory: # string. Alias: rootFolder. Required. Root folder. 
    filePatterns: '**' # string. Required. File patterns. Default: **.
    remoteDirectory: '/upload/$(Build.BuildId)/' # string. Alias: remotePath. Required. Remote directory. Default: /upload/$(Build.BuildId)/.
  # Advanced
    #clean: false # boolean. Delete remote directory. Default: false.
    #cleanContents: false # boolean. Optional. Use when clean = false. Clear remote directory contents. Default: false.
    #overwrite: true # boolean. Overwrite. Default: true.
    #preservePaths: false # boolean. Preserve file paths. Default: false.
    #trustSSL: false # boolean. Trust server certificate. Default: false.

:::moniker-end

:::moniker range="=azure-pipelines-2019"

# FTP Upload v1
# FTP Upload.
- task: FtpUpload@1
  inputs:
    credentialsOption: 'serviceEndpoint' # 'serviceEndpoint' | 'inputs'. Alias: credsType. Required. Authentication Method. Default: serviceEndpoint.
    serverEndpoint: # string. Required when credsType = serviceEndpoint. FTP Service Connection. 
    #serverUrl: # string. Required when credsType = inputs. Server URL. 
    #username: # string. Required when credsType = inputs. Username. 
    #password: # string. Required when credsType = inputs. Password. 
    rootDirectory: # string. Alias: rootFolder. Required. Root folder. 
    filePatterns: '**' # string. Required. File patterns. Default: **.
    remoteDirectory: '/upload/$(Build.BuildId)/' # string. Alias: remotePath. Required. Remote directory. Default: /upload/$(Build.BuildId)/.
  # Advanced
    #clean: false # boolean. Delete remote directory. Default: false.
    #cleanContents: false # boolean. Optional. Use when clean = false. Clear remote directory contents. Default: false.
    #overwrite: true # boolean. Overwrite. Default: true.
    #preservePaths: false # boolean. Preserve file paths. Default: false.
    #trustSSL: false # boolean. Trust server certificate. Default: false.

:::moniker-end

Inputs

:::moniker range=">=azure-pipelines-2019"

credentialsOption - Authentication Method
Input alias: credsType. string. Required. Allowed values: serviceEndpoint (FTP service connection), inputs (Enter credentials). Default value: serviceEndpoint.

Specifies the authentication method. Use an FTP service connection or enter the connection credentials.


:::moniker-end

:::moniker range=">=azure-pipelines-2019"

serverEndpoint - FTP Service Connection
string. Required when credsType = serviceEndpoint.

Specifies the service connection for the FTP server. To create one, click the Manage link and create a new generic service connection, and then enter the FTP server URL for the server URL, e.g. ftp://server.example.com, and the required credentials.

Secure connections will always be made regardless of the specified protocol (ftp:// or ftps://) if the target server supports FTPS. To allow only secure connections, use the ftps:// protocol, e.g. ftps://server.example.com. Connections to servers not supporting FTPS will fail if ftps:// is specified.


:::moniker-end

:::moniker range="<=azure-pipelines"

serverUrl - Server URL
string. Required when credsType = inputs.

Specifies the URL for the FTP server.


:::moniker-end

:::moniker range="<=azure-pipelines"

username - Username
string. Required when credsType = inputs.

Specifies the user name for the FTP connection.


:::moniker-end

:::moniker range="<=azure-pipelines"

password - Password
string. Required when credsType = inputs.

Specifies the password for the FTP connection.


:::moniker-end

:::moniker range="<=azure-pipelines"

rootDirectory - Root folder
Input alias: rootFolder. string. Required.

Specifies the source folder to upload files from.


:::moniker-end

:::moniker range="<=azure-pipelines"

filePatterns - File patterns
string. Required. Default value: **.

Specifies the file paths or patterns of the files to upload. The string supports multiple lines of minimatch patterns. Learn more about file matching patterns.


:::moniker-end

:::moniker range="<=azure-pipelines"

remoteDirectory - Remote directory
Input alias: remotePath. string. Required. Default value: /upload/$(Build.BuildId)/.

Specifies the directory on the remote FTP server where the task uploads files.


:::moniker-end

:::moniker range="<=azure-pipelines"

clean - Delete remote directory
boolean. Default value: false.

Deletes the remote directory, including its contents, before uploading.


:::moniker-end

:::moniker range="<=azure-pipelines"

cleanContents - Clear remote directory contents
boolean. Optional. Use when clean = false. Default value: false.

Recursively deletes all content in the remote directory before uploading. The existing directory will not be deleted. For better performance, use clean instead.


:::moniker-end

:::moniker range="<=azure-pipelines"

overwrite - Overwrite
boolean. Default value: true.

Overwrites existing files in the remote directory.


:::moniker-end

:::moniker range="<=azure-pipelines"

preservePaths - Preserve file paths
boolean. Default value: false.

If selected, the relative local directory structure is recreated under the remote directory where files are uploaded. Otherwise, files are uploaded directly to the remote directory without creating additional subdirectories.

For example, suppose your source folder is /home/user/source/, which contains the file foo/bar/foobar.txt, and your remote directory is: /uploads/. If this boolean is selected, the file is uploaded to /uploads/foo/bar/foobar.txt. If this boolean is not selected, the file is uploaded to /uploads/foobar.txt.


:::moniker-end

:::moniker range="<=azure-pipelines"

trustSSL - Trust server certificate
boolean. Default value: false.

Trusts the FTP server's SSL certificate with ftps://, even if it is self-signed or cannot be validated by a certificate authority (CA).


:::moniker-end

Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

:::moniker range="<=azure-pipelines"

None.

:::moniker-end

Remarks

Use this task to upload files to a remote machine using FTP or securely with FTPS.

:::moniker range=">=azure-pipelines-2019.1"

Note

There is a newer version of this task available at FtpUpload@2.

:::moniker-end

Where can I learn more about file matching patterns?

Requirements

:::moniker range=">=azure-pipelines-2022"

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 Utility

:::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 All supported agent versions.
Task category Utility

:::moniker-end