Muokkaa

Jaa


FtpUpload@1 - FTP upload v1 task

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

This version of the task is deprecated; use FtpUpload@2.

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

Syntax

# 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.
# 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.

Inputs

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.


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.


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

Specifies the URL for the FTP server.


username - Username
string. Required when credsType = inputs.

Specifies the user name for the FTP connection.


password - Password
string. Required when credsType = inputs.

Specifies the password for the FTP connection.


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

Specifies the source folder to upload files from.


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.


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.


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

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


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.


overwrite - Overwrite
boolean. Default value: true.

Overwrites existing files in the remote directory.


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.


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).


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

None.

Remarks

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

Note

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

Where can I learn more about file matching patterns?

Requirements

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
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