-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenkins scripts
55 lines (45 loc) · 1.08 KB
/
jenkins scripts
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
#!/bin/bash
DEVICE="$1"
THREAD="-j$(grep -c ^processor /proc/cpuinfo)"
export TZ="Asia/Kolkata"
export KBUILD_BUILD_USER="$USER"
source build/envsetup.sh
if [ -f "out/.lock" ]; then
rm out/.lock
fi
aospa="vendor/aospa/"
arrow="vendor/arrow/"
evolutionx="vendor/evolution/"
env=vendor/*/build/envsetup.sh
is_check="brunch"
if [ -f "$env" ]; then
echo "File $env does not exist."
exit 1
fi
if [ -d "$arrow" ]; then
cmd=$(grep -ci "$is_check" build/envsetup.sh)
else
cmd=$(grep -ci "$is_check" $env)
fi
if [ "$cmd" != "0" ]; then
echo "Brunch exists"
# roast it :)
brunch $DEVICE
else
echo "Brunch does not exist. Time for bacon"
if [ -d "$aospa" ]; then
echo "aospa rom detected"
./rom-build.sh $DEVICE
elif [ -d "$arrow" ]; then
echo "arrow rom detected"
lunch arrow_$DEVICE-userdebug
mka bacon $THREAD
elif [ -d "$evolution" ]; then
echo "evolution rom detected"
lunch evolution_$DEVICE-userdebug
mka evolution $THREAD
else
lunch aosp_$DEVICE-userdebug
mka bacon $THREAD
fi
fi