Deploy only changes with LFTP

Hi,

We’re running an older gen project and we need to deploy pushes to our main branch using LFTP.
The problem we’re having is that each push uploads all of the files instead of only changes. Currently our pipeline looks like this:

image: ubuntu:18.04

before_script:
  - apt-get update -qy
  - apt-get install -y lftp

build:
  script:
    # Sync to FTP
    - lftp -e "set ftp:ssl-allow no;open $FTP_IP; user $FTP_USERNAME $FTP_PASSWORD; mirror -X .* -X .*/ --reverse --verbose -n localDir/ remoteDir/; bye"

I’ve googled what to do, but didn’t find a clear answer. Can anyone help me with this situation?

Thanks

So to answer my own question…the problem had to with timestamps. There’s a GIT tool that restores them so the pipeline now looks like this:

build:
  image: ubuntu:latest
  stage: build
  script:
    - apt update
    - apt install git-restore-mtime -y
    # - ls -la
    # This command restores the modified timestamps from commits
    - /usr/lib/git-core/git-restore-mtime
    # - ls -la
    - apt-get update -qy
    - apt-get install -y lftp
    # Sync to FTP
    - lftp -e "set ftp:ssl-allow no;open $FTP_IP; user $FTP_USERNAME $FTP_PASSWORD; mirror -X .* -X .*/ --reverse --verbose --only-newer -n localDir/ remoteDir/; bye"

@luft

Hi,

I was facing the same issue and then tried your solution. Unfortunately, it doesn’t work: all the HTML pages are regenerated again.

Do you understand why it doesn’t work in my cases?

Thanks!