S
S
Sergey Ashikhmin2016-07-26 10:18:32
git
Sergey Ashikhmin, 2016-07-26 10:18:32

The post-receive hook on the c gitolite server throws an error - any ideas what needs to be corrected in it?

We switch to using git , deployed on the gitolite server with authorization by keys.
To transfer the code to the test site after the commit, I use the post-receive hook
. I found this code on the Internet.

#!/bin/bash
#CONFIG
LIVE="/home/www/our_site/"
read oldrev newrev refname
if [ $refname = "refs/heads/master" ]; then  
    echo "===== DEPLOYING TO LIVE SITE ====="  
    cd $LIVE
    umask 002
    git reset --hard
    git pull origin master
    composer update
    echo "===== DONE ====="
fi

push passes, but the data on the test server does not change, I see an error in the client
remote: ===== DEPLOYING TO LIVE SITE =====
remote: fatal: Not a git repository: '.'
remote: ===== DONE =====
if you go to the folder of the test site and execute
git pull origin master - the data is updated. I ask for advice - what to correct in this script for correct work? or how to organize the transfer of changes to the test server.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Danil Biryukov-Romanov, 2016-07-26
@urtow

1) How to make a transfer - make a CI server. It's obviously simpler and clearer
2) You can't see the error as a whole, does this script run on the test server, and not on the server with gitolite? (if they are different servers)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question