提交 35b0692c authored 作者: Travis Cross's avatar Travis Cross

Add script for build testing patches

This is intended to make it easier to describe to users on JIRA how
they should test build patches in a standardized manner and how to
collect a full build log that includes the exact git commit they are
building.
上级 32bbe11d
#!/bin/bash
set -e -o pipefail
usage () {
printf "usage: %s [-u <remote>] [-r <ref>] [<patch-urls> ...]\n" "$0" >&2
}
err () {
printf "error: %s\n" "$1" >&2
exit 1
}
remote=origin
ref=origin/master
dopull=true
while getopts "hnr:u:" o; do
case "$o" in
h) usage; exit 0 ;;
n) dopull=false ;;
r) ref="$OPTARG" ;;
u) remote="$OPTARG" ;;
esac
done
shift $(($OPTIND-1))
if ! which git >/dev/null; then
printf "error: please install git\n">&2
exit 1; fi
if ! which wget >/dev/null; then
printf "error: please install wget\n">&2
exit 1; fi
now=$(date -u +%Y%m%dT%H%M%SZ)
git clean -fdx || err "failed"
git reset --hard "$ref" \
|| err "reset failed"
$dopull && (git pull "$remote" || err "failed to pull")
for patch in "$@"; do
wget -O - "$patch" | git am
done
printf '# Building FreeSWITCH %s\n' "$(git describe HEAD)" \
> ${now}-fsbuild.log
(./bootstrap.sh && ./configure -C && make VERBOSE=1) 2>&1 \
| tee -a ${now}-fsbuild.log
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论