Answer the question
In order to leave comments, you need to log in
And how to properly configure git-ftp in .gitlab-ci.yml?
For deployment to test and production servers in .gitlab-ci.yml I use lftp.
stages:
- deploy
deploy_staging:
stage: deploy
script:
- echo "Deploy to staging server"
- apt-get update -qq && apt-get install -y -qq lftp
- lftp -c "set ftp:ssl-allow no; open -u $USERNAME,$PASSWORD $HOST; mirror -Rnev ./ /domains/www/private_html/staging/ --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/ --exclude staging/ --exclude /sitemap.xml"
only:
- develop-production
deploy_prod:
stage: deploy
script:
- echo "Deploy to production server"
- apt-get update -qq && apt-get install -y -qq lftp
- lftp -c "set ftp:ssl-allow no; open -u $USERNAME,$PASSWORD $HOST; mirror -Rnev ./ /domains/www/private_html/ --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/ --exclude staging/ --exclude /sitemap.xml"
when: manual
only:
- master
deploy_prod:
stage: deploy
script:
- echo "Deploy to production server"
- apt-get update -qq && apt-get install -y -qq git-ftp
- git ftp init --user $USERNAME --password $PASSWORD ftp://***.com
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question