logo
1
0
Login
docs: 文档过长行换行

FTPS

Upload artifacts via FTP (lftp command)

Parameter Description

  • username: FTP username
  • password: FTP password
  • hostname: FTP host, including port
  • clean_dir: If set to true, the destination directory (dest_dir) will be deleted before file transfer. Cannot be used together with only_newer
  • chmod: If false, file permission changes will be forced after file transfer. Default is empty
  • verify: If true, forces SSL certificate verification; otherwise, no verification. true or false, default: false
  • secure: Whether to use SSL encryption. true: Use SSL encryption to protect the privacy and security of FTP data transfer. false or unset: Do not use SSL encryption
  • dest_dir: Location to place files on the remote server. For example: /path/to/dest
  • src_dir: Local directory for upload. For example: /path/to/src
  • exclude: egrep-like pattern matching to exclude files from upload, supports array format or comma-separated values
  • include: egrep-like pattern matching for files to upload, supports array format or comma-separated values
  • auto_confirm: When this parameter has a value, it enables SFTP auto-confirmation feature. Auto-confirmation is disabled by default. During SFTP transfer, there are times when user confirmation is needed, such as file permission changes, file deletion, etc. By default, lftp will prompt users for confirmation when encountering these operations. However, in some cases, users may want to automatically confirm these operations to avoid manual intervention.
  • pre_action: Commands to execute on the server before file transfer (executed before clean_dir)
  • post_action: Commands to execute on the server after file transfer
  • debug: When this parameter has a value, debug mode is enabled; when empty, debug mode is disabled. When lftp command starts in debug mode, it will output detailed debug information, including sent and received network packets, internal state changes, etc.

Usage in Cloud Native Build

Simple Example

main: push: - stages: - name: deploy image: tencentcom/ftps # Reference secret repository configuration file imports: https://cnb.cool/group/secret-repo/-/blob/main/env.yml settings: hostname: example.com:21 src_dir: ./ dest_dir: /data/release exclude: ^\.git/$ # Username, from environment variable in imports file username: $LOGIN_USER # Password, from environment variable in imports file password: $LOGIN_PASSWORD

To avoid exposing username and password, it is recommended to reference files from the secret repository to obtain username and password, for example:

# Content of https://cnb.cool/group/secret-repo/-/blob/main/env.yml LOGIN_USER: xxx LOGIN_PASSWORD: xxx # Declare which plugin tasks with specific images can reference this configuration file allow_images: - tencentcom/ftps # Declare which pipeline with specific repositories can reference this configuration file allow_slugs: - groupname/reponame