]> git.ozlabs.org Git - next-scripts/blob - rebase_end
make_tree_file: ABAT can fetch a git tree
[next-scripts] / rebase_end
1 #!/bin/bash
2
3 LOG_FILE="../merge.log"
4 build_host="sprygo"
5 build_dir="/scratch/sfr/next"
6 build_cmd="bin/build_next"
7
8 no_build=false
9 [ "$1" = "-n" ] && {
10         shift
11         no_build=true
12 }
13 [ -n "$1" ] && build_host="$1"
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 execute git checkout master || {
28         echo "git checkout failed" 1>&2
29         exit
30 }
31 GIT_EDITOR=: execute git merge temp || {
32         echo merge failed 1>&2
33         bash -i || exit
34 }
35 execute git branch -d temp
36
37 $no_build && exit 0
38
39 rsync -avH --exclude .git --delete . "$build_host":"$build_dir"/. || {
40         echo Rsync failed 1>&2
41         bash -i || exit
42 }
43
44 echo "Building using $build_cmd on $build_host"
45 ssh "$build_host" "$build_cmd" || {
46         echo Build failed 1>&2
47         bash -i || exit
48 }
49
50 exit 0