Deleting files in public_html via .cpanel.yml before deploying from repo
Hi there,
I deploy files from my repo to the public_html folder via the .cpanel.yml file, this works great.
BUT...
I want to delete the files that are already in public_html because i don't want the different versions to overlap.
Tried this, it deletes the files but then failes at copying the new ones:
Could anyone tell me why this won't work and possibly suggest a solution? Thanks in advance, Bart
---
deployment:
tasks:
- export DEPLOYPATH=/home//public_html/
- cd ../../public_html
- rm -r *
- mkdir test
- cd ../repositories/cprepo
- cp README.md $DEPLOYPATH
Could anyone tell me why this won't work and possibly suggest a solution? Thanks in advance, Bart
-
Hey there! I know you've already specified the path in a previous command, but seeing a wildcard with the "rm" command still scares me a bit. It would be best to use full paths instead of the "cd ../../" and for the rm as well - can you try that and see if that works? 0 -
Thanks for your reply @cPRex. However, i was not aware of the existence of te rsync command. This one command with its --delete and --exclude flags was all i need. 0 -
I'm glad you were able to find a fix for that! 0
Please sign in to leave a comment.
Comments
3 comments