]> git.ozlabs.org Git - next-scripts/blob - do_patch
update to_build_host a bit
[next-scripts] / do_patch
1 #!/bin/bash
2
3 no_build=false
4 [ "$1" = "-n" ] && {
5         shift
6         no_build=true
7 }
8
9 patch="$1"
10 shift
11
12 . "$(dirname $0)/common.sh"
13
14 log()
15 {
16         echo "$@" | tee -a $LOG_FILE
17 }
18
19 execute()
20 {
21         log "$" $@
22         $@ 2>&1 | tee -a $LOG_FILE
23         return ${PIPESTATUS[0]}
24 }
25
26 GIT_EDITOR=: execute git am -3 "$patch" || exit 1
27
28 $no_build && exit 0
29
30 git push -f "${build_host}${build_host:+:}${build_dir}" master:refs/heads/next || {
31         echo git push failed 1>&2
32         bash -i || exit
33 }
34 "$bin_dir/do_build" || {
35         echo Build failed 1>&2
36         bash -i || exit
37 }
38
39 exit 0