I've managed to get Git setup properly and have been able to successfully pull down from my Cpanel repository, commit changes and push back up to my Cpanel repository. I currently have my Cpanel.yml file setup like such:
I am able to log into Cpanel and see that my push was successful and that I have new files to deploy (see the attached screenshot). I am able to deploy manually, with my files accurately updating staging.$domain.com. I am unable to deploy automatically upon push to my Cpanel repository though.
I have verified that I have a post-receive file, located in my Git repository, under the file path /.git/hooks/post-receive
This is the contents of that file:
I can verify that there is a file called uapi in the path /usr/bin but I cannot access /usr/local/cpanel/ to verify any files or folders there. I cannot see anything in my .git logs that would indicate that there was a problem. It just doesn't seem to activate the post-receive. I did change permissions on the file to 777, just to ensure it wasn't an issue with permissions.
Am I missing something? Help?
[Moderator note: removed identifying information]
YAML:
---
deployment:
tasks:
- export DEPLOYPATH=/home/$cpuser/subdomains/staging.$domain.com/
- /bin/cp -R * $DEPLOYPATH
I have verified that I have a post-receive file, located in my Git repository, under the file path /.git/hooks/post-receive
This is the contents of that file:
Bash:
#!/bin/sh
# post-receive Copyright 2018 cPanel, Inc.
# All rights reserved.
# [email protected] http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited
branch=$(/usr/local/cpanel/3rdparty/bin/git branch | awk '$1 == "*"{print $2}')
while read oldrev newrev ref
do
if [ "x$ref" == "xrefs/heads/$branch" ]
then
echo "Received update on checked-out branch, queueing deployment."
(cd .. ; /usr/bin/uapi VersionControlDeployment create repository_root=$PWD)
fi
done < /dev/stdin
Am I missing something? Help?
[Moderator note: removed identifying information]
Attachments
-
204.1 KB Views: 3
Last edited by a moderator: