M
M
Maddoger2012-12-11 15:40:04
PHP
Maddoger, 2012-12-11 15:40:04

Deployment to a virtual server from Git

Greetings.

There is a virtual server with a dozen sites under different users. Managed via ISPManager.
It is necessary to push some sites into Git repositories for easy collaboration.

Git installed; configured user with SSH access git:git; created folder /var/git under bare repositories. Further, accordingly, you need to: create a repository, clone it to developers and into the folder with the web server. And here the question arises:

The site works under a specific and separate user (for example, user), he is the owner of the files, access to ftp is provided through him. This user does not have access to the terminal.

I update the Bare repository via SSH and the git user, respectively, when pull is called (via hook), files are created on its behalf.

How to be in such a situation? Ideally, pull through user, but he does not have a terminal.
Perhaps you need to decide through groups, but I don’t really understand their logic.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2012-12-11
Protko @Fesor

stackoverflow.com/questions/1951137/git-post-receive-hook-to-update-a-local-clone-owned-by-a-different-user

N
nick4fake, 2012-12-11
@nick4fake

By hook through sudo we call a script that replaces the rights and updates the sorts. In sudoers we add permission to one (and only to it) file. Important : this file should not be allowed to write a git! The owner of the script is root, but the rights to read to everyone. Why? If you let write, you can execute any commands. If you don't let it read, it won't work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question