Skip to content

Instantly share code, notes, and snippets.

@oquirozm
Created May 18, 2017 10:27
Show Gist options
  • Save oquirozm/6312020f971c34fc0ae370a367188749 to your computer and use it in GitHub Desktop.
Save oquirozm/6312020f971c34fc0ae370a367188749 to your computer and use it in GitHub Desktop.
This is a .yml file to setup up ftp deployment in GitLab. Super awesome. Remember to set up the environmental variables.
deploy:
script:
- apt-get update -qq && apt-get install -y -qq lftp
- lftp -c "set ftp:ssl-allow no; open -u $USERNAME,$PASSWORD $HOST; mirror -Rnev --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/"
only:
- master
@jimmyadaro
Copy link

Just in case someone is wondering about the mirror -Rnev part, from the LFTP man page:

mirror -R [...] uploads or updates a directory tree on server. Mirror can also synchronize directories between two remote servers, using FXP if available.

n [...] download only newer files

e [...] delete files not present at the source

v [...] verbose

Be careful and BACKUP EVERYTHING on the destination path before you deploy anything.

@patrickblackjr
Copy link

Another testament to BACKUP EVERYTHING. Or set a write directory with -O /source-directory/ within the mirror command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment