Revision #251 has been created by rackycz on Jan 2, 2021, 10:19:54 AM with the memo:
girlab
« previous (#250) next (#252) »
Changes
Title
unchanged
Yii v2 snippet guide
Category
unchanged
Tutorials
Yii version
unchanged
2.0
Tags
unchanged
tutorial,beginner,yii2
Content
changed
[...]
**Automatical copying from GitLab to FTP**
---
I found these two pages where things are explained: [link](https://www.savjee.be/2019/04/gitlab-ci-deploy-to-ftp-with-lftp/) [link](https://stackoverflow.com/questions/49632077/use-gitlab-pipeline-to-push-data-to-ftpserver).
You need to create file .gitlab-ci.yml in the root of your repository with this content. It will fire a Pipeline job on commit using "LFTP client".
```[...]
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 ./ $TARGETFOLDER --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/ --exclude vendor --exclude web/assets --exclude web/index.php --exclude web/index-test.php --exclude .gitlab-ci.yml"
only:
- master
```
I just added some exclusions (see the code) and will probably add **--delete** in the future. Read linked webs.[...]