'자동배포'에 해당되는 글 1건

1. remote 저장소로 사용할 디렉토리를 "--base" 옵션을 사용해서 만든다.

$ git init --bare test.git

2. vi 등의 편집기로로 test.git/hooks/post-receive를 열어서 아래 내용을 입력한다.

post-receive 파일이 없으면 만들어준다.

#!/bin/sh
GIT_WORK_TREE=$HOME/public_html git checkout -f


3. post-receive 파일에 실행 권한을 추가해 준다.

chmod +x hooks/post-receive

3. 1번에서 만든 remote 저장소르 push를 하면, post-receive 스크립트가 실행되어,

지정한 경로로 해당 소스를 check out 하여, 결국 배포가 된다.


'Server' 카테고리의 다른 글

MySQL Replication 설정하기  (0) 2014.01.07
Subversion 이전하기  (0) 2014.01.07
Windows Azure 2012 체험.  (0) 2012.11.22
블로그 이미지

설기아빠

,