-
Notifications
You must be signed in to change notification settings - Fork 4
/
feed-publish
executable file
·65 lines (60 loc) · 1.1 KB
/
feed-publish
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
#!/bin/sh
set -e
die() {
echo >&2 "ERROR: $*"
exit 1
}
B=""
ARCH=""
DST=""
PORT=""
FEED=""
PKGTYPE="ipk"
while [ $# -gt 1 ]; do
case "$1" in
--dir)
B="$2"
shift
;;
--arch)
ARCH="$2"
shift
;;
--rsync-to)
DST="$2"
shift
;;
--ssh-port)
PORT="$2"
shift
;;
--feed)
FEED="$2"
shift
;;
--pkg-type)
PKGTYPE="$2"
shift
;;
--)
shift
break
;;
-*)
die "unknown flag '$1'"
;;
*)
break
;;
esac
shift
done
[ -d "$B" ] || die "directory '$B' does not exist"
[ -n "$ARCH" ] || die "missing --arch"
[ -n "$DST" ] || die "missing --rsync-to"
[ -n "$FEED" ] || die "missing --feed"
if [ -n "$PORT" ]; then
export RSYNC_RSH="ssh -p '$PORT'"
fi
rsync -a --info=stats2 \
--delete-after "${B}/tmp/deploy/${PKGTYPE}/" "${DST}/${ARCH}/${FEED}"