Last active
December 5, 2020 16:29
-
-
Save vojtasvoboda/8d6259e28095d5c99216e5bf44b7d320 to your computer and use it in GitHub Desktop.
GitLab CI FTP deploy with mwienk/docker-lftp docker image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stages: | |
- test | |
- deploy | |
cache: | |
paths: | |
- vendor | |
# test job | |
test: | |
stage: test | |
image: edbizarro/gitlab-ci-pipeline-php:7.1 | |
script: | |
- sudo composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts | |
- vendor/bin/phpunit --configuration phpunit.xml | |
# upload job, see https://lftp.yar.ru/lftp-man.html | |
upload: | |
stage: deploy | |
image: mwienk/docker-lftp:latest | |
script: | |
- lftp -e "set ftp:ssl-allow false; mirror -eRnv app web/app; exit;" -u $FTP_USERNAME,$FTP_PASSWORD $FTP_HOST | |
only: | |
- master | |
when: on_success |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I know this is old, but I had some troubles with
mirror
command. Because some FTP servers are not keeping the modify time from the source. But changing it to upload time. I was dealing with it by using another tool (FTP Deployment) to handle changes and LFTP just to do parallel upload.If you are interested, I wrote an article about it here: https://dev.to/arxeiss/parallel-incremental-ftp-deploy-in-ci-pipeline-2511