Answer the question
In order to leave comments, you need to log in
How to properly delete files when deploying a project through Gitlab CI?
Task: to organize updating sites on remote servers after a commit
How it is implemented now:
A post-receive hook has been created for the project. When I commit to the corresponding branch, the files are checked out to the local directory:
git --work-tree=/var/www/test.com --git-dir=/var/opt/gitlab/git-data/repositories/test/test-project.git/ clean -fd
git --work-tree=/var/www/test.com --git-dir=/var/opt/gitlab/git-data/repositories/test/test-project.git/ checkout -f
lftp -e "mirror --delete --exclude \public_html/config.php --exclude \.gitlab-ci.yaml --exclude \public_html/img/. -R /var/www/test.com / ; quit;" -u ftp-user,ftp-password ftp://xxx.xxx.x.xxx:21
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