Git post-receive hook and environment variables

My git server is running on Gitolite under the git system user. I added the git user to ~ / .profile: export STAGE_PATH="/srv/http/stage"as you can guess, I want to automatically place the website from the repo at the stage when the changes are clicked. However, it seems that the STAGE_PATH variable is not available to me in the post-receive hook. This is normal? Is there a way to access environment variables from behind a hook after receiving?

+3
source share
2 answers

How about adding, ~ git /. The profile at the top of your post-receive hook script (suppose sh).

It is not clear what exactly you want. Do you want to:

1) . , ? script?

2) , , , , - . , , , . .profile . , git , script. , , ( .profile).

0

git git , export ed . , .

, for line in $(printenv); do echo $line; done) . , .

+1

All Articles