#!/bin/bash
-LOG_FILE="../merge.log"
-build_host="sprygo"
-build_dir="/scratch/sfr/next"
-build_cmd="bin/build_next"
-
no_build=false
[ "$1" = "-n" ] && {
shift
no_build=true
}
patch="$1"
+shift
[ -f "$patch" ] || {
echo "patch does not exist" 1>&2
exit 1
}
-[ -n "$2" ] && build_host="$2"
+
+. "$(dirname $0)/common.sh"
log()
{
echo "git reset failed" 1>&2
bash -i || exit
}
-execute git add . || {
+execute git add -A . || {
echo "git add failed" 1>&2
bash -i || exit
}
$no_build && exit 0
-rsync -avH --exclude .git --delete . "$build_host":"$build_dir"/. || {
- echo Rsync failed 1>&2
+git push -f "${build_host}${build_host:+:}${build_dir}" master:refs/heads/next || {
+ echo git push failed 1>&2
bash -i || exit
}
-echo "Building using $build_cmd on $build_host"
-ssh "$build_host" "$build_cmd" || {
+"$bin_dir/do_build" || {
echo Build failed 1>&2
bash -i || exit
}