A
A
Alexey Yarkov2017-03-15 21:21:39
git
Alexey Yarkov, 2017-03-15 21:21:39

And from which user does the hook work on the VPS?

I wrote the following script:
https://gist.github.com/yarkovaleksei/8e467a7670d7...
Everything generates normally, displays a list of commands, everything seems to be ok.
But when you try to push it to production, the hook starts working.
In my case, npm install is executed .

$ git remote add production ssh://[email protected]:1234/home/user/bare/api.git
$ git push production master

And this is where things start to go wrong))) Errors are thrown into the console that /usr/bin/nodejs is version 4.2.6. But I use nvm and version 7.6.0 as user user ( /home/user/.nvm/versions/node/v7.6.0/bin/node ).
It turns out I'm running a hook not from user?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2017-03-15
@yarkov

taschemta it is logical that the git on the server is spinning under a different user.
add something like this to your hook whoami > /tmp/gituser.txtand you will definitely know under which user the hook is being executed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question