搭建每日构建环境
最近组织几个人开发一个监控系统,为了能够最快的掌握开发进度,控制质量,搭建了一个每日构建环境。
版本控制采用svn,svn库目录在/sdbdata/svn, svn环境搭建:
- Apr :./configure;make;make test;make install
- Apr-util:./configure;make;make test;make install
- SQLITE: 下载sqlite-amalgamation,解压;把目录mv到subversion目录下
- Svn: ./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr
- SVN: make;make install
- 启动服务:svnserve -d -r /sdbdata/svn 在3690端口监听
- 创建版本库:svnadmin create /var/svn/repos
- 客户端访问:svn://192.168.24.29/repos
- 定制权限:svnserve.conf,在passwd文件中录入帐号和口令口令。
执行每日构建,生成测试用例报告和项目文档,构建脚本如下:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#!/bin/bash
CURDAY=`date +%Y%m%d%H`
#开始检出源码
echo "begin check out ... ..."
svn checkout file:///sdbdata/svn/repos/src/back src
svn checkout file:///sdbdata/svn/repos/test test
echo "end check out."
#开始本地测试
echo "begin local test... ..."
cp `find test -name \*.t` tmp/
cd tmp
for name in *.t
do
echo $name >> ../rpt/Test.log.$CURDAY 2>&1
perl $name >> ../rpt/Test.log.$CURDAY 2>&1
#生成项目文档
tmpname=`echo $name|awk -F. '{print $1;}'`
pod2html $name >> ../doc/${tmpname}.html
#perl -MTest::Harness -e '$$Test::Harness::verbose=1; runtests @ARGV;' *.t>>../RptTest.log.$CURDAY 2>&1
done
3. 将测试报告和项目文档通过apache输出来进行前台访问
在apache/htdocs目录下创建一个连接指向 文档目录
ln -s /sdbdata/develop /apache/htdocs/develop
<Directory "/slview/apache/htdocs/develop"> Options Indexes MultiViews 确保目录可浏览 AllowOverride None Order allow,deny Allow from all </Directory>
4. 测试报告和项目文档访问
项目文档访问:http://192.168.24.29/develop/doc
测试报告访问:http://192.168.24.29/develop/rpt