Upload artifacts via FTP (lftp command)
username: FTP usernamepassword: FTP passwordhostname: FTP host, including portclean_dir: If set to true, the destination directory (dest_dir) will be deleted before file transfer.
Cannot be used together with only_newerchmod: If false, file permission changes will be forced after file transfer. Default is emptyverify: If true, forces SSL certificate verification; otherwise, no verification. true or false, default: falsesecure: 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 encryptiondest_dir: Location to place files on the remote server. For example: /path/to/destsrc_dir: Local directory for upload. For example: /path/to/srcexclude: egrep-like pattern matching to exclude files from upload, supports array format or comma-separated valuesinclude: egrep-like pattern matching for files to upload, supports array format or comma-separated valuesauto_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 transferdebug: 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.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