forked from tvheadend/tvheadend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Autobuild.sh
executable file
·94 lines (84 loc) · 1.45 KB
/
Autobuild.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
#
# Entry point for the Doozer autobuild system
#
# (c) Andreas Öman 2011. All rights reserved.
#
#
set -eu
BUILD_API_VERSION=3
EXTRA_BUILD_NAME=""
JARGS=""
JOBSARGS=""
TARGET=""
ARCHOVR=""
RELEASE="--release"
WORKINGDIR="/var/tmp/showtime-autobuild"
FILELIST="$PWD/filelist.txt"
OP="build"
OSPREFIX=""
while getopts "vht:e:j:w:o:p:a:c:" OPTION
do
case $OPTION in
v)
echo $BUILD_API_VERSION
exit 0
;;
h)
echo "This script is intended to be used by the autobuild system only"
exit 0
;;
t)
TARGET="$OPTARG"
;;
e)
EXTRA_BUILD_NAME="$OPTARG"
;;
j)
JOBSARGS="--jobs=$OPTARG"
JARGS="-j$OPTARG"
;;
w)
WORKINGDIR="$OPTARG"
;;
a)
ARCHOVR="$OPTARG"
;;
p)
OSPREFIX="$OPTARG"
;;
o)
OP="$OPTARG"
;;
esac
done
if [[ -z $TARGET ]]; then
source Autobuild/identify-os.sh
if ! [[ -z $ARCHOVR ]]; then
ARCH=$ARCHOVR
fi
TARGET="$DISTRO-$ARCH"
fi
TARGET=$OSPREFIX$TARGET
#
# $1 = local file path
# $2 = type
# $3 = content-type
# $4 = filename
#
artifact() {
echo "doozer-artifact:$PWD/$1:$2:$3:$4"
echo "$PWD/$1" >> "$FILELIST"
}
versioned_artifact() {
echo "doozer-versioned-artifact:$PWD/$1:$2:$3:$4"
echo "$PWD/$1" >> "$FILELIST"
}
git status
if [ -f Autobuild/${TARGET}.sh ]; then
echo "Building for $TARGET"
source Autobuild/${TARGET}.sh
else
echo "target $TARGET not supported"
exit 1
fi