cschlosser / drone-ftps

Deploy to FTPS server from Drone CI build
https://hub.docker.com/r/cschlosser/drone-ftps/
Apache License 2.0
20 stars 16 forks source link

How to debug this if it is not working #25

Closed Bouni closed 2 years ago

Bouni commented 2 years ago

I try to mirror a folder to an SFTP on a Synology NAS but th eonly thing I see in the Drone output log is

latest: Pulling from cschlosser/drone-ftps
Digest: sha256:7442ec050d7b05c3ff4f14e92e9bb0def4028ba555844591815434de8a5fe8ee
Status: Image is up to date for cschlosser/drone-ftps:latest

And there it hangs forever ...

Here's my .drone.yml

kind: pipeline
name: default

steps:
  - name: build PDFs
    image: python
    commands:
      - pip install poetry
      - poetry install
      - poetry run python build_documents.py

  - name: copy PDFs to SFTP
     image: cschlosser/drone-ftps
     environment:
       FTP_USERNAME:
         from_secret: SFTP_USER
       FTP_PASSWORD:
         from_secret: SFTP_PASSWORD
       PLUGIN_HOSTNAME: sftp.server.com:50022
       PLUGIN_DEST_DIR: /home/PDFs
       PLUGIN_SECURE: true
       PLUGIN_VERIFY: false
       PLUGIN_EXCLUDE: ^\.git/$
       PLUGIN_SRC_DIR: /output
       PLUGIN_CLEAN_DIR: true

If I get a shell within the running drone comtaine docker exec -it drone-Vf20L9DukrGr6ias1eun bash and do a ps I see the command is running:

bash-5.1# echo "$(ps)"
PID   USER     TIME  COMMAND
    1 root      0:00 {upload.sh} /bin/bash /bin/upload.sh
    9 root      0:00 lftp -e set xfer:log 1;   set ftp:ssl-allow true;   set ftp:ssl-force true;   set ftp:ssl-protect-data true;   set ssl:verify-certificate false;   set ssl:check-hostname false;   set net:max-retries 3;   rm -r /home/PDFs;   mirror --verbose  -R    -x '^\.git/$' /drone/src/output /home/PDFs -u <redacted>,<redacted> sftp.server.com:50022
   20 root      0:00 bash
   29 root      0:00 ps

Any idea why this isn't working?

Bouni commented 2 years ago

I sent a PR that fixes this issue. Just in case somebody stumbles upon the same problem, here's a short explanation what I found:

  1. I had to specify the protocol explicitly in PLUGIN_HOSTNAME in order to work (sftp://sftp.server.com:50022)
  2. The option set sftp:auto-confirm yes was necessary in order to answer the question Are you sure you want to continue connecting (yes/no/[fingerprint])? automatically with yes