/
server2.sh
98 lines (77 loc) · 2.52 KB
/
server2.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
94
95
96
#!/bin/bash
ydate=$(date -d '1 day ago' +"%m/%d/%Y")
sdate="$2"
cdate=`date +"%m_%d_%Y"`
DATE=`date +"%Y%m%d"`
rdir=`pwd`
RELEASE="$1"
OFFICIAL="$3"
if [ "$RELEASE" == "official" ]
then
echo "Building Official Release";
export RB_BUILD="$OFFICIAL"
else
echo "Building Nightly"
export RB_NIGHTLY="$DATE"
fi
echo "Generating Changelog"
# Generate Changelog
# Check the date start range is set
if [ -z "$sdate" ]; then
sdate=${ydate}
fi
# Find the directories to log
find $rdir -name .git | sed 's/\/.git//g' | sed 'N;$!P;$!D;$d' | while read line
do
cd $line
# Test to see if the repo needs to have a changelog written.
log=$(git log --pretty="%an - %s" --no-merges --since=$sdate --date-order)
project=$(git remote -v | head -n1 | awk '{print $2}' | sed 's/.*\///' | sed 's/\.git//')
if [ -z "$log" ]; then
echo "Nothing updated on $project, skipping"
else
# Prepend group project ownership to each project.
origin=`grep "$project" $rdir/.repo/manifest.xml | awk {'print $4'} | cut -f2 -d '"'`
if [ "$origin" = "aokp" ]; then
proj_credit=AOKP
elif [ "$origin" = "aosp" ]; then
proj_credit=AOSP
elif [ "$origin" = "cm" ]; then
proj_credit=CyanogenMod
elif [ "$origin" = "faux" ]; then
proj_credit=Faux123
elif [ "$origin" = "bajee" ]; then
proj_credit=RootBox
elif [ "$origin" = "rootbox" ]; then
proj_credit=RootBox
else
proj_credit=""
fi
# Write the changelog
echo "$proj_credit Project name: $project" >> "$rdir"/changelog.txt
echo "$log" | while read line
do
echo " •$line" >> "$rdir"/changelog.txt
done
echo "" >> "$rdir"/changelog.txt
fi
done
# Build Devices on Server 2
. build_release2.sh i9100 "$RELEASE" "$OFFICIAL"
. build_release2.sh n7000 "$RELEASE" "$OFFICIAL"
. build_release2.sh i9100g "$RELEASE" "$OFFICIAL"
. build_release2.sh i9300 "$RELEASE" "$OFFICIAL"
. build_release2.sh n7100 "$RELEASE" "$OFFICIAL"
. build_release2.sh t0lte "$RELEASE" "$OFFICIAL"
. build_release2.sh t0lteatt "$RELEASE" "$OFFICIAL"
. build_release2.sh i605 "$RELEASE" "$OFFICIAL"
. build_release2.sh l900 "$RELEASE" "$OFFICIAL"
. build_release2.sh find5 "$RELEASE" "$OFFICIAL"
# Remove Changelogs
if [ "$RELEASE" == "nightly" ]
then
rm "$rdir"/changelog.txt
else
rm "$rdir"/changelog.txt
fi
echo "RootBox packages built, Changelog generated and everything uploaded to server!"