forked from avary/android-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cm7Jenkins.sh
executable file
·73 lines (54 loc) · 1.72 KB
/
cm7Jenkins.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
#!/bin/bash
export device=$1
export BUILD_NO=$BUILD_NUMBER
unset BUILD_NUMBER
WORKDIR=$WORKSPACE
OUTPUT=$WORKDIR
SOURCE=$WORKDIR/source
date1=`date +%Y%m%d`
date2=`date +%m%d%Y`
date3=`date +%m-%d-%Y`
numProcs=$(( `cat /proc/cpuinfo | grep processor | wc -l` + 1 ))
checkStatus()
{
STAT=$?
[[ $STAT -ne 0 ]] && exit $STAT
}
cd $SOURCE
export CYANOGEN_NIGHTLY=1
export USE_CCACHE=1
if [[ ${device} = "leo" ]] ; then
sed -i s/developerid=cyanogenmodnightly/developerid=cyanogenmodleonightly/g vendor/cyanogen/products/common.mk
# To make it for only cLK
sed -i 's/\(^TARGET_CUSTOM_RELEASETOOL.*\)/#\1/g' device/htc/${device}/BoardConfig.mk
fi
cp ./vendor/cyanogen/products/cyanogen_${device}.mk buildspec.mk
if [[ $device = "leo" ]] ; then
# Copying the latest kernel stuff from the automated jenkins build
cp ~jenkins/workspace/leo_kernel_gb/android_kernel_cmhtcleo-out/boot/zImage ./device/htc/leo/prebuilt/kernel
cp ~jenkins/workspace/leo_kernel_gb/android_kernel_cmhtcleo-out/system/lib/modules/* ./device/htc/leo/prebuilt/modules/.
fi
echo "Getting ROMManager"
./vendor/cyanogen/get-rommanager
checkStatus
echo -n "setting up environment ... "
. build/envsetup.sh
checkStatus
echo -n "running brunch ... "
lunch cyanogen_${device}-eng
checkStatus
make -j ${numProcs} bootimage
checkStatus
make -j ${numProcs} bacon
checkStatus
mkdir -p $OUTPUT
cp $SOURCE/out/target/product/${device}/cm-7-*.zip $OUTPUT/cm-7-${date1}-NIGHTLY-${device}.zip
if [[ $UPLOAD = "true" ]] ; then
scp_arif_domain $OUTPUT/cm-7-${date1}-NIGHTLY-${device}.zip public_html/cyanogenmod/rom
scp $OUTPUT/cm-7-${date1}-NIGHTLY-${device}.zip [email protected]:public_html/cm7
checkStatus
fi
cd $WORKSPACE
rm -rf $SOURCE
checkStatus
exit 0