3 LOG_FILE="../merge.log"
5 build_dir="/scratch/sfr/next"
6 build_cmd="bin/build_next"
15 echo "patch does not exist" 1>&2
18 [ -n "$2" ] && build_host="$2"
22 echo "$@" | tee -a $LOG_FILE
28 $@ 2>&1 | tee -a $LOG_FILE
29 return ${PIPESTATUS[0]}
32 execute git am -3 "$patch" || {
33 echo "git am failed" 1>&2
36 GIT_EDITOR=: execute git reset 'HEAD^' || {
37 echo "git reset failed" 1>&2
40 execute git add . || {
41 echo "git add failed" 1>&2
44 GIT_EDITOR=: execute git commit -v -a --amend || {
45 echo "git commit failed" 1>&2
51 rsync -avH --exclude .git --delete . "$build_host":"$build_dir"/. || {
52 echo Rsync failed 1>&2
56 echo "Building using $build_cmd on $build_host"
57 ssh "$build_host" "$build_cmd" || {
58 echo Build failed 1>&2