Publish to FTP(S)

by christophschlosser

The FTPS plugin can be used to publish artifiacts over FTP(S). The below pipeline configuration demonstrates simple usage:

pipeline:
  deploy:
    image: cschlosser/drone-ftps
    hostname: example.com:21
    secrets: [ ftp_username, ftp_password ]

Example configuration using secure flag:

pipeline:
  deploy:
    image: cschlosser/drone-ftps
    hostname: example.com:21
    secrets: [ ftp_username, ftp_password ]
+   secure: true

Example configuration using dest_dir to specify where to put the files on the remote server:

pipeline:
  deploy:
    image: cschlosser/drone-ftps
    hostname: example.com:21
    secrets: [ ftp_username, ftp_password ]
    secure: true
+   dest_dir: /var/www/mysite

Example configuration using src_dir to upload only the static site generated:

pipeline:
  deploy:
    image: cschlosser/drone-ftps
    hostname: example.com:21
    secrets: [ ftp_username, ftp_password ]
    secure: true
    dest_dir: /var/www/mysite
+   src_dir: /mysite/static

Example configuration using exclude to prevent dotfiles from getting uploaded:

pipeline:
  deploy:
    image: cschlosser/drone-ftps
    hostname: example.com:21
    secrets: [ ftp_username, ftp_password ]
    secure: true
    dest_dir: /var/www/mysite
    src_dir: /mysite/static
+   exclude:
+     - ^\.git/$
+     - ^\.gitignore$
+     - ^\.drone.yml$

Example configuration using include to only upload HTML, CSS and JS files:

pipeline:
  deploy:
    image: cschlosser/drone-ftps
    hostname: example.com:21
    secrets: [ ftp_username, ftp_password ]
    secure: true
    dest_dir: /var/www/mysite
    src_dir: /mysite/stati
    exclude:
      - ^\.git/$
      - ^\.gitignore$
      - ^\.drone.yml$
+   include:
+     - ^*.css$
+     - ^*.js$
+     - ^*.html$

Secret Reference

FTP_PASSWORD
password used to login to the FTP server with the specified user
FTP_USERNAME
Username used to login to the FTP server

Parameter Reference

hostname
FTP host including the port
secure
if set to true FTPS is enforced, otherwise plain FTP is used (default true)
dest_dir
where to put the files on the remote server (default /)
src_dir
which local directory should be used for the upload (default ./)
exclude
egrep like pattern matching to exclude files from uploading (default none)
include
egrep like pattern matching to include files to upload (default none)