I have setup my plesk website to automatically pull changes from a remote repository to a certain path of the webserver via post-hooks as described here.
However my repository contains a git submodule and I need to run the custom command git submodule update --remote
as well. How can I tell plesk to do that. The commands I can enter in the
Enable Additional Deployment Actions
Setting seem not to be executed in the correct path. Also when I go to the path the repository syncs to on my server i get:
fatal: Not a git repository (or any of the parent directories): .git
How can I achive to tell plesk to update submodules too with the git plugin?
In my case it was two problems. It was a setting for a subdomain, where the folderstructure is different in plesk.
First I had to set the "Additional Deployment Action" to
# find the correct git folders / repositorys by ssh-ing onto your server
git --git-dir=/var/www/vhosts/example.com/git/example.git --work-tree=/var/www/vhosts/example.com/subdomain.example.com/path/to/working-directory/ submodule update --init --recursive
The second problem was that the submodule was placed on github, so I had to add the specific subdomain ssh-key to github. It can be found in.
/var/www/vhosts/example.com/.ssh/id_rsa.pub
even for the subdomain. Hope that helps someone else.
Check if you are in the right folder (as I show here)
Then check your environment variables (seen here): GIT_DIR
or GIT_WORK_TREE
, as set by Plex, to make sure they are not interfering.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With