【发布时间】:2011-08-23 19:32:35
【问题描述】:
一个基于 cron、bash + make 的脚本(例如,比 Hudson 更小、更不健壮)如何构建机器人轮询 git 存储库并检测它是否应该现在构建 - 例如如果在从远程 git repo 定期拉取时,它已检索到新代码?
目前,它看起来像这样:
git fetch > build_log.txt 2>&1
if [ $? -eq 0 ]
then
echo "Fetch from git done";
git merge FETCH_HEAD >> build_log.txt 2>&1 ;
if [ $? -eq 0 ]
then
echo "Merge via git done"; ...
# builds unconditionally at the moment
fi
fi
【问题讨论】:
标签: git shell continuous-integration build-automation