[v1.7-dev] Attach Git to your CyberPanel sites!

there was no error when attaching the repo. it was attached successfully.

can I test the git pull by command line? or any other ways to find the logs, etc?

Go to the directory where repo is attached such as cd /home/yourdomain.com/public_html and do `git pull</code

just had another round of testing. whenever I attach a git repo successfully, it will remove the public_html folder. as in, there was an empty public_html folder before I attach it to the repo.

also, the public_html folder reappear when I detach the repo from the web admin page.

okay. I have setup the git clone manually using "git clone [email protected]:<username>/<repo_name>.git ." to public_html folder I created, and it is now working with the webhook. so I guess it is to do with the setup part of the admin site not working at the moment. when I use the admin page to attach a repo, it removes the public_html folder with no .git folder created, etc. for now, I will just use the manual way. if there is anything you need me to test more, let me know. glad to help to fix it for everyone. it’s a great feature!

@pb007

Can you describe your environment using the format available here → Bug Report Template - Bug Report - CyberPanel Community

Also mention your virtualization type (KVM, OpenVZ)

Provider: Digital Ocean

System: CentOS 7.6, Cyberpanel 1.8 Build 2

Installation option: Plain install from https://cyberpanel.net/install.sh

OLS or Enterprise?
OLS

Installing from official server or mirror server?
Official

Replace JS/CSS files to JS Delivr?
no (standard install?)

Install Memcached extension for PHP?
no (standard install?)

Install LiteSpeed Memcached?
yes (standard install?)

Install Memcached?
no (standard install?)

Install Redis extension for PHP?
yes (standard install?)

Install Redis?
yes (standard install?)

Problem:

When I try to attach git repo, it shows successful message, but on server, the public_html folder is deleted and no .git folder.
I can manually recreate public_html folder and then do the git pull over ssh myself, then it works with the webhook setup.

@pb007

Can you create a ticket on https://platform.cyberpanel.net/

Provide CyberPanel logins and your repo details.

seconded @pb007, I am facing the exact issue. once attach git repo the public_html folder is removed and cannot perform git pull until folder is cloned manually

@samcharles93 create your ticket using the above link, would like to reproduce the issue on your end.

When i try to follow the installation steps I get
“/dev/fd/63: line 1: syntax error near unexpected token newline' /dev/fd/63: line 1: '”
in the command line.

@xurjob sorry?

@xurjob sorry?

Has attaching Git repos to CyberPanel sites been working for version 1.9? Just recently had to reinstall my entire cyberpanel instance after a bad upgrade and noticed this new feature. But it doesn’t work properly after succesfully git attachment. Constantly get the “Permission denied (public key)” error message when the use the cyberpanel provided deploy key. Only got it to work when I ssh-keygen as root but that doesn’t allow me to use the webhooks from cyberpanel.

it was working for me before. but recently stopped. now I can see successful webhook call from GitHub log, 200, {“error_message”: “None”, “pulled”: 1}. but it doesn’t pull. but if I do it manually (git pull) from the public_html folder, it works.

@pb007

I just tried on Centos 7 and everything seems to work fine including web hooks.

I am running it on CentOS 7.6 x64. I can manually go to the public_html folder to do “git pull” and it works, so the keys are fine, etc. and there are no obvious error from calling the webhook neither. any suggestion on where I can look for other logs, etc?

just had a chance to setup a new website to test this again. using latest 1.9 build 1. attach git to a freshly created website will say it was successful, but it won’t set the content to the repo’s. it will still have the cyberpanel default page. then I tried to remove the public_html folder and recreate. I can do a git clone to the repo. so the keys are all fine. on the GitHub side, the webhook log, 200, {“error_message”: “None”, “pulled”: 1}, every time I commit new code. but it won’t be pulled to the server. still wanting to know where I can find the logs.

finally got it working. installed another vps and it all worked fine. I went back to check back on the old server, somehow the deploy keys was different. I have not reinstalled the old server at all, but the deploy keys updated itself. with the wrong deploy keys, will still get 200, {“error_message”: “None”, “pulled”: 1} from GitHub. so just detach the old git setup, check the keys and attach again.

I’m trying to clone a Gitlab repository but Cyberpanel keeps giving me this error: “Error message: . [404]”

The repository to clone is https://gitlab.com/f_liva/statamic-alithia, then from the page https://:8090/websites//setupGit I set “f_liva” in the Username field, “statamic-alithia” in the Repository Name field and than select Gitlab (no feedback at click).

I proceed to the next page by clicking on the Attach Now button, then after a few moments appears the red box with “Error message: . [404]”

On Gitlab I have correctly set the Deploy Key from the Repository > Settings > CI / CD > Deploy Keys page.

What am I doing wrong?