forked from KhasMek/pseudo_buildbot
-
Notifications
You must be signed in to change notification settings - Fork 2
/
deploy.sh
executable file
·68 lines (58 loc) · 1.49 KB
/
deploy.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
#!/bin/bash
KANGS=/home/remicks
BUILD_ROOT=`pwd`
cd $KANGS
./cherrypicks.sh
cd $BUILD_ROOT
. build/envsetup.sh
# parse options
while getopts ":c :o:" opt
do
case "$opt" in
c) CLEAN=true;;
o)
THEME_VENDOR="$OPTARG"
echo "using $THEME_VENDOR vendorsetup.sh"
;;
\?)
echo "invalid option: -$OPTARG"
echo "exiting..."
exit 1
;;
esac
done
# check for clean
if [ "$CLEAN" = "true" ]; then
echo "sanitizing build enviornment"
rm -rf out
rm .bot_lunch
fi
# find the ROM vendor from the manifest path for Pseudo
ROM_VENDOR=$(grep pseudo_buildbot .repo/manifest.xml | cut -f4 -d ' ' | cut -f2 -d '/')
# see if we are using a theme overlay or the ROM's vendorsetup
if [ "$THEME_VENDOR" != "" ]; then
# using a theme overlay
VENDOR="$THEME_VENDOR"
else
# find the ROM vendor from the manifest path for Pseudo
VENDOR="$ROM_VENDOR"
fi
# make sure file exists
if [ ! -f vendor/$VENDOR/vendorsetup.shh ]; then
echo "vendorsetup.sh not found"
echo "exiting..."
exit 1
fi
# aokp_vzwtab-userdebug
cat vendor/$VENDOR/vendorsetup.sh | cut -f2 -d ' ' > .bot_lunch
# build packages
#
# read the file and execute lunch
while read line ;do
# vzwtab
DEVNAME=$(echo $line | cut -f2 -d ' ' | cut -f2 -d '_' | cut -f1 -d '-')
# build_device <lunch combo> <device name>
./vendor/$ROM_VENDOR/bot/build_device.sh $line $DEVNAME
done < .bot_lunch
# don't be messy
rm .bot_lunch