Gitlab-ci issue

I created a .gitlab-ci.yml file to auto deploy to my staging area. This is the file I wrote.

deploy to staging:
environment: staging
script:

  • lftp -p 2222 sftp://$FTPUSER_STAGING:$FTPPASSWD_STAGING@$FTPHOST_STAGING -e “set ssl:verify-certificate no; set sftp:auto-confirm yes; mirror -R . /public_html”
    only:
  • master
    when: manual
    tags:
  • xieles

Mine is a CakePHP project. For some reason, only 3 files in the root folder is getting uploaded to staging. It upload only .gitlab-ci.yml, README.md and .htaccess files. It skipped index.php file and all sub folders. Is there any problem with the .gitlab-ci.yml file

If I read the lftp manual correctly, your mirror -R ./public_html expects both a local and remote public_html directory right?

What kind of runner are you using? shell? You could try to reproduce your script commands in the build directory on your runner to see what happens when manually executing the commands?

There is local and remote directory mentioned. There is a space after .(dot), so it is mirror -R . /public_html same as mirror -R ./ /public_html

Check. Didn’t see that. How about the manual steps?

When I do it manually from the build directory, all files are getting transferred.

The problem seems to be with -R option of mirror. When I change that to --reverse, it works correctly.

Cool, so its solved?

Yes, its fixed.

Very strange though. -R and --reverse are same ( http://smyl.es/using-lftp-ftp-to-mirrortransfer-files-from-one-server-to-another/ ). Can this be a bug?