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