Using GitLab CI to transfer files via ftp to the shared hosting

Hello,

I am working on small project and want to automatize file upload. I use GitLab CI and my gitlab-ci.yml looks like

stages:
  - deploy

deploy:
  stage: deploy
  image: mwienk/docker-lftp:latest
  script:
    - lftp -c "set ssl:verify-certificate no; set ftp:ssl-allow no; open -u $FTP_USER,$FTP_PASS $FTP_HOST; mirror -Rnev ./ $DIR_PATH --no-symlinks --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/"
  only:
    - master

After push to the branch, script starts lftp command which fails every time with mirror: Login failed: 530 Login authentication failed

I have tried it run from local and it went without any error.

Please help what am I doing wrong ?

Probably too late, but someone might find it helpful. In my case, the problem was ftp account being geographically restricted by hosting provider. That’s why the same command worked locally, but not from shared runner.