svn auto commit & 1일 빌드

/usr/local/bin 에 svn이 있다는 가정하에.

~/svn_auto_commit.sh
_________________________________________________________________________________________________
#!/bin/bash

cd ~/svnhome/project/
C_DATE=`date "+%Y-%m-%d %H:%M:%S"`

echo $C_DATE > ~/svn_auto_commit_result.txt

echo "svn diff Result :" >>~/svn_auto_commit_result.txt
/usr/local/bin/svn diff >>~/svn_auto_commit_result.txt

echo "svn commit" >>~/svn_auto_commit_result.txt
/usr/local/bin/svn commit -m"autocommit" >> ~/svn_auto_commit_result.txt

mail -s "svn auto commit mail" 메일주소 <~/svn_auto_commit_result.txt

rm -rf ~/svn_auto_commit_result.txt
_________________________________________________________________________________________________

이렇게 한 후 
crontab 에 등록해준다.

crontab -e
0 0 * * *  ~/svn_auto_commit.sh

하루에 한번 commit 해주고 결과를 메일로 보내준다.

svn update 나 test build 등도 필요하다면 넣어 줄 수 있다.

make 시는 stderr 쪽에 내용이 남기 때문에

make clean

make -j4 >& ~/make_result.txt

이런식으로 남긴 다음

mail -s "make test resultl" 메일주소 <~/make_result.txt

이런식으로 해주면 테스트 빌드결과가 에러도 제대로 남게된다.

PS. 

* * * * * ~/svn_auto_commit.sh 으로 해주면 1분에 한번씩 실행하게 된다. 테스트 하기 좋다.
by 우주괴물 | 2008/10/20 20:33 | Linux | 트랙백 | 덧글(0)
트랙백 주소 : http://nomoreid.egloos.com/tb/3949458
☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]

:         :

:

비공개 덧글



< 이전페이지 다음페이지 >