Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I finally got the solution on my own, thanks for VonC for the pointers.<br> My solution may not beauty but yet work. </p> <p>So here are the steps that work in my solution: </p> <ol> <li><p>I create a bare repositories which will have the same user permission with the web application. </p></li> <li><p>In Gitolite Repositories folder (in Ubuntu: /var/lib/gitolite/repositories), i create a post-receive hook which will mirror the the repository the bare repo that i just created. Code is: </p> <p><code>#!/bin/bash<br> echo '==== DO MIRROR ===='<br> git push --mirror user@host:path/to/bare.git<br> echo '==== DONE MIRROR ===='</code> </p></li> <li><p>And in my web application, i will create a remote that connect to that bare repo. </p></li> <li><p>Then i create a post-receive hook in the mirrored bare repo, that will ask the web application to pull from it. The code: </p> <p><code>#!/bin/bash<br> WORK_DIR="/home/ivan/public_html/test/testing"<br> read oldrev newrev refname<br> if [ $refname = "refs/heads/master" ]; then<br> echo "===== DEPLOYING TO LIVE SITE ====="<br> unset GIT_DIR<br> cd $WORK_DIR<br> git pull mirror-repo master<br> echo "===== DONE ====="<br> fi </code></p></li> <li><p>Don't forget to chmod +x for both post-receive.</p></li> </ol> <p>As i said before, it may not beautiful but yet work, at least for my current situation. The reason why i'm not just pull it from the gitolite repositories is because of user file permissions. In Ubuntu (install from apt-get), gitolite hold user and group, gitolite:gitolite. and my web application is under my home folder (i'm using suPHP) which have user and group ivan:ivan. So when i pushed to the gitolite repositories, it will run the bash script under gitolite user, which cannot access the .git folder under my home folder. </p> <p>So yes, for those who have better solutions, i'm eager to hear from you.<br> Thanks hope my solution may help others.<br> Ivan</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload