b0chard Posted yesterday at 11:13 AM Posted yesterday at 11:13 AM Hi there! I would like to ask for assistance on deploymentof my website with git submodules in it. I have a php website, I use Git on plesk to pull my repository on github and deploy it automatically using a webhook. Now, this repository has git submodules in it. But, I have no idea on how to add it on the file manager on plesk everytime it pulls the repo. I tried this method, hoping it would work, but nah: It throws me this error whenever it pulls the repo haha: this is how it looks on my website when it deploys. it just shows the index of that folder: Would be glad to someone help me on this. Thank youu!! Quote
wolstech Posted 23 hours ago Posted 23 hours ago The deployment actions are jailed to your home folder. Since git's binaries don't live in your home folder, it can't find the binary. There is a workaround for this limitation involving CGI that can be tried. Here's a link to another case where a user used that workaround to run npm for a node app, you should be able to adapt it to run git commands instead. https://helionet.org/index/topic/63231-run-npm-script-in-git-deploy-actions/ Note that the "create a scheduled task and run it at lease once" step that I mentioned in one of my replies over is essential. It won't work if you don't do that first (you'll get an error that curl isn't found). Quote
b0chard Posted 23 hours ago Author Posted 23 hours ago Hi wolstech, nice to see you again! here is what I did: 1. create a scheduled task, then run it. 2. go to Website & Domains > Git, then pull now. but I still got this error: Quote
wolstech Posted 22 hours ago Posted 22 hours ago You need to write a CGI script in a language like perl or python to run the git commands. Then you would use curl in the deploy actions to call the script via http. The curl call will trigger the CGI script, which will cause Apache to run the handler for the cgi, which will in turn run your git commands outside of the jail. Assuming you use Python to make the CGI script, you end up with a flow that looks like: Git Plesk Deploy calls curl->curl request to .py file->apache receives request and calls Python to process script->Python calls git->git processes submodules. Quote
b0chard Posted 8 hours ago Author Posted 8 hours ago (edited) I don't know what I'm doing now 🥴😮💨 so, here's what I did. 1. created a `submodule_update.py` file in the httpdocs/cgi-bin/ and changed the permission to 755 (rwx r-x r-x). 2. after that, I go to the websites & domains > git, then change the config to run additional deployment actions. I manually pulled and deploy, no errors shown. but the files from the submodules aint still updating on its respective submodule folders. Edit: Is the git folder really found at the root instead inside the httpdocs folder? Edited 6 hours ago by b0chard Quote
wolstech Posted 3 hours ago Posted 3 hours ago I'll have to take a look when I'm on a computer, but I can see just from the screenshots you posted that the path in the os.chdir command is wrong. It should be /home/tenkyuu.dev/git... The path you have listed as missing the domain ( your home folder is /home/tenkyuu.dev) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.