#要考虑的几点:
1. 保存到log, 最好命令、输出以及错误都重定向到文件中(同时显示到屏幕),将log软连接到latest,方便每次查看
2. 每一步的结果都要校验并做对应处理(提示出错,或者自动做某些work)
3. 结果报告,理论上可以通过远程的IP查出用户,并发对应邮件(但是不要发太多的邮件,例行的发,偶然的结果不用发)
4. 持续更新中。。。
#########################################################################
#
# Name: ci ( Continuous Integration)
# Purpose: It aims to continuously improve the quality of the product, and
# it also could be used to verify the code before the code are submit
# to svn.
#
#########################################################################
## Prepare the code
LOG=log-`date +%m%d%y-%H%M%S`
ln -s $LOG latest
set -v
exec 2>&1 1>> $LOG //用此方法导致当前的输出重定向到别的文件中,中间子进程不能再打开log文件做其他处理(exec不能跟tee管道组合)
#rm -rf dx2_linux
#svn update
if [ $? -eq 1 ]
then
echo "svn update failed"
exit 1
fi
cd dx2_linux
make clean
if [ $? -eq 1 ]
then
echo "make clean failed"
exit 1
fi
make
if [ $? -eq 1 ]
then
echo "make failed"
exit 1
fi
sh Load
if [ $? -eq 1 ]
then
echo "Load failed"
exit 1
fi