forked from commaai/openpilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_release2.sh
executable file
·96 lines (75 loc) · 2.35 KB
/
build_release2.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
#!/usr/bin/env bash
set -e
export GIT_COMMITTER_NAME="Vehicle Researcher"
export GIT_COMMITTER_EMAIL="[email protected]"
export GIT_AUTHOR_NAME="Vehicle Researcher"
export GIT_AUTHOR_EMAIL="[email protected]"
export GIT_SSH_COMMAND="ssh -i /data/gitkey"
# set CLEAN to build outside of CI
if [ ! -z "$CLEAN" ]; then
# Create folders
rm -rf /data/openpilot
mkdir -p /data/openpilot
cd /data/openpilot
# Create git repo
git init
git remote add origin [email protected]:commaai/openpilot.git
git fetch origin devel-staging
else
cd /data/openpilot
git clean -xdf
git branch -D release2-staging || true
fi
git fetch origin release2-staging
git fetch origin dashcam-staging
# Create release2 with no history
if [ ! -z "$CLEAN" ]; then
git checkout --orphan release2-staging origin/devel-staging
else
git checkout --orphan release2-staging
fi
VERSION=$(cat selfdrive/common/version.h | awk -F[\"-] '{print $2}')
echo "#define COMMA_VERSION \"$VERSION-release\"" > selfdrive/common/version.h
git commit -m "openpilot v$VERSION"
# Build signed panda firmware
pushd panda/
CERT=/tmp/pandaextra/certs/release RELEASE=1 scons -u .
mv board/obj/panda.bin.signed /tmp/panda.bin.signed
popd
# Build stuff
ln -sfn /data/openpilot /data/pythonpath
export PYTHONPATH="/data/openpilot:/data/openpilot/pyextra"
scons -j3
# Run tests
python selfdrive/manager/test/test_manager.py
selfdrive/car/tests/test_car_interfaces.py
# Cleanup
find . -name '*.a' -delete
find . -name '*.o' -delete
find . -name '*.os' -delete
find . -name '*.pyc' -delete
find . -name '__pycache__' -delete
rm -rf panda/board panda/certs panda/crypto
rm -rf .sconsign.dblite Jenkinsfile release/
rm models/supercombo.dlc
# Move back signed panda fw
mkdir -p panda/board/obj
mv /tmp/panda.bin.signed panda/board/obj/panda.bin.signed
# Restore phonelibs
git checkout phonelibs/
# Mark as prebuilt release
touch prebuilt
# Add built files to git
git add -f .
git commit --amend -m "openpilot v$VERSION"
# Print committed files that are normally gitignored
#git status --ignored
if [ ! -z "$PUSH" ]; then
git remote set-url origin [email protected]:commaai/openpilot.git
# Push to release2-staging
git push -f origin release2-staging
# Create dashcam release
git rm selfdrive/car/*/carcontroller.py
git commit -m "create dashcam release from release2"
git push -f origin release2-staging:dashcam-staging
fi