V
V
Vladislav Altyncev2017-07-12 20:20:54
git
Vladislav Altyncev, 2017-07-12 20:20:54

Deploying a git project to a server domain?

How to properly deploy a repository to a server?
1. There is Gogs, a git service, it has a repository.
2. On the same server there is a test domain where files from the dev branch should be poured after pushing changes.
3. On another server, there is a production domain where files from the master branch should be poured.
Actually, as I understand it, all this is implemented through hooks?
Maybe there is a "collection" of hooks?)
I tried this for a regular deployment:

#!/bin/sh
git --work-tree=/var/www/site.ru/data --git-dir=/var/www/gogs.ru/gogs-repositories/vlad/site.git checkout -f

But as I understand it, files will not be deleted here. How to add a branch here? To look only in the dev branch.
And it's not entirely clear how to organize an ftp deployment to production.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question