-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
30 lines (23 loc) · 1.08 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
website-sync
============
Scripts used to hook into post-receive chain of gitolite, such that when an
authorised user pushes certain branches to the repository, the content is
synced to a (remote) webhost.
website-sync is invoked on the gitolite host, by the post-receive hook
website-pull is invoked on the webserver host, via SSH from website-sync
Assumptions
-----------
1) ~/.ssh/config of the gitolite user is setup to forward SSH connections to
'webhost' to the correct server.
2) website-pull is setup in ~/.ssh/authorized_keys to be invoked whenever an
incoming SSH connection with the relevant SSH key is received (as it uses
SSH_ORIGINAL_COMMAND to retrieve the arguments).
3) that an executable script exists on the webserver host relative to the
login path, with the name of the repository. This will likely need to do:
$ git fetch -q --all
$ git --bare update-server-info
$ export GIT_WORK_TREE=/srv/...
$ git reset -q --hard $branch
$ git checkout -qf $branch
4) Git repo's on the webhost have been mirror-cloned using:
git clone --mirror <remote git url>