Path: blob/master/Tools/vagrant/initvagrant-autotest-server.sh
4232 views
#!/bin/bash12# after this has run you should be able to:34# vagrant ssh autotest-server5# APM/build_autotest.sh67# this should run through the autobuild steps and leave binaries in8# APM/buildslogs/binaries. It is worth applying patches to9# build_binaries.py, board_list.py and autotest.py to shorten cycle10# times while testing infrastructure changes.1112set -e13set -x1415# swiped from initvagrant.sh:1617VAGRANT_USER=ubuntu18if [ -e /home/vagrant ]; then19# prefer vagrant user20VAGRANT_USER=vagrant21fi22echo USING VAGRANT_USER:$VAGRANT_USER2324cd /home/$VAGRANT_USER2526echo "calling pre-reqs script..."27sudo -H -u $VAGRANT_USER /vagrant/Tools/environment_install/install-prereqs-ubuntu.sh -y28echo "...pre-reqs script done... initvagrant.sh continues."2930# end called from initvagrant.sh3132apt install -y timelimit g++-10-aarch64-linux-gnu3334# autotest server doesn't use our standard pattern of dumping things in /opt:35mkdir -p arm-gcc36pushd arm-gcc37ln -sf /opt/gcc-arm-none-eabi-10-2020-q4-major g++-10.2.138popd3940cat <<"EOF" | sudo -u $VAGRANT_USER -H bash4142# configure git so we can tag43git config --global user.email "[email protected]"44git config --global user.name "Your Name"454647mkdir -p APM48pushd APM4950# clone ArduPilot and related repos51if test -e APM; then52pushd APM53git fetch origin54git reset --hard origin/master55popd56else57git clone https://github.com/ardupilot/ardupilot APM58fi5960for i in MAVProxy pymavlink; do61if test -e $i; then62pushd APM63git fetch origin64git reset --hard origin/master65popd66else67git clone https://github.com/ardupilot/$i68fi69done7071mkdir -p buildlogs72cp APM/Tools/scripts/build_autotest.sh .73popd7475EOF7677NEW_CRONTAB="/tmp/new.crontab"78cat >"$NEW_CRONTAB" <<"EOF"79#*/5 * * * * /home/vagrant/APM/build_autotest.sh80#*/15 * * * * /home/vagrant/bin/sitl_dl.sh81#*/15 * * * * /home/vagrant/bin/qurt_dl.sh82#*/15 * * * * /home/vagrant/bin/update_webtools.sh83#*/5 * * * * /home/vagrant/APM/generate-all-files-html.sh84#*/5 * * * * /home/vagrant/APM/env-dump.sh85#*/5 * * * * /home/vagrant/APM/update_mp.sh86#*/5 * * * * /home/vagrant/APM/APM/Tools/scripts/unpack_mp.sh /home/vagrant/APM/buildlogs/binaries/Tools/MissionPlanner >> APM/unpack.log87#0 0 * * * /home/vagrant/APM/cleanup.sh88#0 */3 * * * /home/vagrant/bin/fetch_ublox_assist.sh89#*/5 * * * * /home/vagrant/bin/chibios_svn_update.sh90#1 */6 * * * /home/vagrant/bin/chibios_svn_zip.sh91#3 */1 * * * /home/vagrant/bin/gen_manifest.sh92#*/5 * * * * /home/vagrant/cron/gen_build_sizes.sh93## 0 3 * * * /home/vagrant/cron/run-update-features.sh94#10 */4 * * * /home/vagrant/bin/fwstats.sh95#10 7 * * * /home/vagrant/cron/clean_hex.sh96EOF9798crontab -u $VAGRANT_USER $NEW_CRONTAB99100101102