The system cannot deploy error from GIT repo

SP Hosting

Registered
Jan 24, 2019
4
1
1
OR
cPanel Access Level
Root Administrator
I delete the GIT repo and re-did it so many times + tried to create the .cpanel.yml many times but it keeps not working. Does .cpanel.yml need to have certain permissions, I can't figure out whats wrong. Here is the message:

The system cannot deploy
For deployment, ensure that your repository meets the following requirements:

  1. A valid .cpanel.yml file exists. For more information, read our documentation.
  2. No uncommitted changes exist on the checked-out branch.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
Hello @SP Hosting,

Can you post the contents of the .cpanel.yml file you have setup? Ensure to replace any identifying information about your server with an example.

Thank you.
 

SP Hosting

Registered
Jan 24, 2019
4
1
1
OR
cPanel Access Level
Root Administrator
Just to clarify my GIT repo is directly in the public_html folder, so that is where that file is placed.. Also I have tried several different things in there. But here is whats in it now:

.cpanel.yml
---
deployment:
tasks:
- export DEPLOYPATH=/home/cPuser/public_html
- /bin/cp -r * $DEPLOYPATH
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
.cpanel.yml
---
deployment:
tasks:
- export DEPLOYPATH=/home/cPuser/public_html
- /bin/cp -r * $DEPLOYPATH
Hello @SP Hosting,

The use of a wildcard character, such as an asterisk to deploy all files, is not recommended. Also, if your deploy path is the same directory as the repo, the command you are using would simply copy all files to the same location. Start by moving your Git repo to a directory above public_html (e.g. /home/username/gitrepo), create a directory named "testing" with a couple of test files, and then update the /home/username/gitrepo/.cpanel.yml file to look like this:

Code:
---
deployment:
  tasks:
    - export DEPLOYPATH=/home/username/public_html/
    - /bin/cp -R /home/username/gitrepo/testing $DEPLOYPATH
Verify this works first, and we can proceed to assist you with tuning the custom deployment command.

Thank you.
 

kamm

Well-Known Member
Jan 17, 2004
51
1
158
Spain
cPanel Access Level
Root Administrator
The Guide to Git™ - Deployment documentation doesn't mention using an absolute path to directories / files that are to be deployed.

IMHO something like this would be a more useful example:

YAML:
---
deployment:
  tasks:
    - export DEPLOYPATH=/home/cpanel_username/
    - /bin/cp -R /home/cpanel_username/repo/public_html $DEPLOYPATH
    - /bin/cp -R /home/cpanel_username/repo/lib $DEPLOYPATH
Also, I didn't notice mention of the vc_*_get_deploy.log files which I found helpful once I realised where they were.

i.e.
log_path: /home/cpanel_username/.cpanel/logs/