Issue
I've been following documentation at https://docs.cpanel.net/knowledge-base/web-services/guide-to-git-deployment/
My issue is that my subfolders don't get copied unless I cheat.
The only way I can get my desired result is by using the command:
- /bin/cp -r * $DEPLOYPATH
The problem with that is that is copies things you don't want copied
Here is the code that is failing me:
deployment:
tasks:
- export DEPLOYPATH=/home/X/Y.com/
- /bin/cp formEmailer.php $DEPLOYPATH
- /bin/cp index.html $DEPLOYPATH
- /bin/cp landing.html $DEPLOYPATH
- /bin/cp portfolio.html $DEPLOYPATH
- /bin/cp thank-you.html $DEPLOYPATH
- /bin/cp style.css $DEPLOYPATH
- /bin/cp -r /home/X/wbs/images $DEPLOYPATH
- /bin/cp -r /home/X/wbs/assets $DEPLOYPATH
The last two lines aren't working for me. I've also tried them like this:
- /bin/cp -r images $DEPLOYPATH
- /bin/cp -r assets $DEPLOYPATH
Could anyone suggest the correct syntax to have my subfolders of images and assets other than just wildcarded the whole root folder?
The layout of the files is a root folder with the html and css files, and then there exists two subfolders(images, assets). Assets also has subfolders. images just has images and no additional subfolders.
Solution
Here, I'm copying all files in the public folder from my project's root directory to public_html.
deployment:
tasks:
- export DEPLOYPATH=/home/username/public_html
- /bin/cp -r public/. $DEPLOYPATH
The alternative, like you tried, is to copy the entire public folder itself to public_html by using the following commands:
deployment:
tasks:
- export DEPLOYPATH=/home/username/public_html
- /bin/cp -r public $DEPLOYPATH
Answered By - Murray OB