-
Notifications
You must be signed in to change notification settings - Fork 0
/
client-aliases.sh
69 lines (66 loc) · 1.54 KB
/
client-aliases.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
export PSQL_FORWARD_PORT=5555
function engine {
if [ $# -lt 1 ]; then
[ -z $ENGINE_HOST ] &&
echo "No engine build-slave specified in the ENGINE_HOST environment variable" ||
echo "Current engine build-slave at $ENGINE_HOST"
return
fi
command=$1
shift
function ssh-cmd {
ssh engine@$ENGINE_HOST $*
}
function ssh-less {
ssh-cmd -t "less $1"
}
case $command in
push)
git push -f ssh://engine@$ENGINE_HOST/home/engine/ovirt-engine.git "$(git rev-parse --abbrev-ref HEAD)"
;;
debug)
echo "Starting debug port-forward to host $ENGINE_HOST"
ssh-cmd -nNT -L 8787:localhost:8787 -L "$PSQL_FORWARD_PORT":localhost:5432 -L 8000:localhost:8000
;;
psql)
PGPASSWORD=engine psql -h localhost -p $PSQL_FORWARD_PORT -U engine
;;
run)
ssh-cmd '$SCRIPTS_DIR/run.sh'
;;
cleanup)
ssh-cmd '$SCRIPTS_DIR/cleanup.sh'
;;
gwt)
ssh-cmd -X -A "\$SCRIPTS_DIR/gwt.sh $1" &
$BROWSER "$ENGINE_HOST:8080/ovirt-engine/$1/?gwt.codesvr=$ENGINE_HOST"
;;
log)
ssh-less $PREFIX/var/log/ovirt-engine/engine.log
;;
build-log)
ssh-less build.log
;;
ssh)
ssh-cmd $*
;;
esac
}
function vdsm {
command=$1
shift
function ssh-cmd {
ssh root@$VDSM_HOST "$*"
}
case $command in
push)
git push -f ssh://root@$VDSM_HOST/root/vdsm.git "$(git rev-parse --abbrev-ref HEAD)"
;;
status)
ssh-cmd "service vdsmd status"
;;
restart)
ssh-cmd "service vdsmd restart"
;;
esac
}