On my Plesk 11 Server i create an subdomain: sub.domain.tld
For all the users i create a svn+ssh tunnel. All users committed through this tunnel.
Now i want to create SVN Hook so that every commit should be directly update into sub.domain.tld
I'm using this tutorial but i always get /bin/sh: /var/.../hooks/post-commit: Permission denied
I guess because domain and subdomain was created from Plesk itself.
How can i make my subversion be able to post-commit into a directory created by Plesk?
It doesn't matter how Subversion is served, the hooks all operate the same way on the server.
Hooks are executed by the server. Therefore, you need to make sure that the hook itself has execute permission set, and that it is owned by the user who runs the SVN Server. Also, the environment is stripped clean when a hook is executed. So, the $PATH
might not be set the way you want.
Usually, when you see this type of error, it's due to one of these issues. My recommendation is to make a very simple hook (this is the Unix/Linux version):
#! /bin/bash
echo "The hook has executed" >&2
exit 2
This hook is guaranteed to fail which is what you want. When a hook fails, the output printed to STDERR is returned to the user. You should see something like this:
The post-commit hook failed with the output of "The hook has executed"
If you don't see that, you know that Subversion is failing to execute your hook, and it's not a problem with the hook. Check the things mentioned above: Is the execute bit on the hook? Is the hook (and the entire repository) owned by the user that executes the Subversion server process. (For example, usually apache
, httpd
, or wwwrun
when running under Apache httpd.
Since you're running under svn+ssh
, you need to make sure that the GROUP ownership is the same group as your users, that the GROUP execute permission is set correctly, and that the UMASK for all of your users is set to 0002
and not to just 0022
.
Now, let's look at what you want:
Now i want to create SVN Hook so that every commit should be directly update into sub.domain.tld
It appears you want a particular working copy to be updated whenever someone commits a change. You can do this through a pre-commit hook, but I recommend you use Jenkins for this type of stuff.