Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Ardupilot
GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Tools/vagrant/initvagrant-autotest-server.sh
4232 views
1
#!/bin/bash
2
3
# after this has run you should be able to:
4
5
# vagrant ssh autotest-server
6
# APM/build_autotest.sh
7
8
# this should run through the autobuild steps and leave binaries in
9
# APM/buildslogs/binaries. It is worth applying patches to
10
# build_binaries.py, board_list.py and autotest.py to shorten cycle
11
# times while testing infrastructure changes.
12
13
set -e
14
set -x
15
16
# swiped from initvagrant.sh:
17
18
VAGRANT_USER=ubuntu
19
if [ -e /home/vagrant ]; then
20
# prefer vagrant user
21
VAGRANT_USER=vagrant
22
fi
23
echo USING VAGRANT_USER:$VAGRANT_USER
24
25
cd /home/$VAGRANT_USER
26
27
echo "calling pre-reqs script..."
28
sudo -H -u $VAGRANT_USER /vagrant/Tools/environment_install/install-prereqs-ubuntu.sh -y
29
echo "...pre-reqs script done... initvagrant.sh continues."
30
31
# end called from initvagrant.sh
32
33
apt install -y timelimit g++-10-aarch64-linux-gnu
34
35
# autotest server doesn't use our standard pattern of dumping things in /opt:
36
mkdir -p arm-gcc
37
pushd arm-gcc
38
ln -sf /opt/gcc-arm-none-eabi-10-2020-q4-major g++-10.2.1
39
popd
40
41
cat <<"EOF" | sudo -u $VAGRANT_USER -H bash
42
43
# configure git so we can tag
44
git config --global user.email "[email protected]"
45
git config --global user.name "Your Name"
46
47
48
mkdir -p APM
49
pushd APM
50
51
# clone ArduPilot and related repos
52
if test -e APM; then
53
pushd APM
54
git fetch origin
55
git reset --hard origin/master
56
popd
57
else
58
git clone https://github.com/ardupilot/ardupilot APM
59
fi
60
61
for i in MAVProxy pymavlink; do
62
if test -e $i; then
63
pushd APM
64
git fetch origin
65
git reset --hard origin/master
66
popd
67
else
68
git clone https://github.com/ardupilot/$i
69
fi
70
done
71
72
mkdir -p buildlogs
73
cp APM/Tools/scripts/build_autotest.sh .
74
popd
75
76
EOF
77
78
NEW_CRONTAB="/tmp/new.crontab"
79
cat >"$NEW_CRONTAB" <<"EOF"
80
#*/5 * * * * /home/vagrant/APM/build_autotest.sh
81
#*/15 * * * * /home/vagrant/bin/sitl_dl.sh
82
#*/15 * * * * /home/vagrant/bin/qurt_dl.sh
83
#*/15 * * * * /home/vagrant/bin/update_webtools.sh
84
#*/5 * * * * /home/vagrant/APM/generate-all-files-html.sh
85
#*/5 * * * * /home/vagrant/APM/env-dump.sh
86
#*/5 * * * * /home/vagrant/APM/update_mp.sh
87
#*/5 * * * * /home/vagrant/APM/APM/Tools/scripts/unpack_mp.sh /home/vagrant/APM/buildlogs/binaries/Tools/MissionPlanner >> APM/unpack.log
88
#0 0 * * * /home/vagrant/APM/cleanup.sh
89
#0 */3 * * * /home/vagrant/bin/fetch_ublox_assist.sh
90
#*/5 * * * * /home/vagrant/bin/chibios_svn_update.sh
91
#1 */6 * * * /home/vagrant/bin/chibios_svn_zip.sh
92
#3 */1 * * * /home/vagrant/bin/gen_manifest.sh
93
#*/5 * * * * /home/vagrant/cron/gen_build_sizes.sh
94
## 0 3 * * * /home/vagrant/cron/run-update-features.sh
95
#10 */4 * * * /home/vagrant/bin/fwstats.sh
96
#10 7 * * * /home/vagrant/cron/clean_hex.sh
97
EOF
98
99
crontab -u $VAGRANT_USER $NEW_CRONTAB
100
101
102