Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/Tools/scripts/build_autotest.sh
Views: 1798
#!/usr/bin/env bash12export PATH=$HOME/.local/bin:/usr/local/bin:$HOME/prefix/bin:$HOME/gcc/active/bin:$PATH3export PYTHONUNBUFFERED=145cd $HOME/APM || exit 167test -n "$FORCEBUILD" || {8(cd APM && git fetch > /dev/null 2>&1)910newtags=$(cd APM && git fetch --tags --force | wc -l)11oldhash=$(cd APM && git rev-parse origin/master)12newhash=$(cd APM && git rev-parse HEAD)1314if [ "$oldhash" = "$newhash" -a "$newtags" = "0" ]; then15echo "$(date) no change $oldhash $newhash" >> build.log16exit 017fi18echo "$(date) Build triggered $oldhash $newhash $newtags" >> build.log19}2021############################22# grab a lock file. Not atomic, but close :)23# tries to cope with NFS24lock_file() {25lck="$1"26pid=`cat "$lck" 2> /dev/null`2728if test -f "$lck" && kill -0 $pid 2> /dev/null; then29LOCKAGE=$(($(date +%s) - $(stat -c '%Y' "build.lck")))30test $LOCKAGE -gt 80000 && {31echo "old lock file $lck is valid for $pid with age $LOCKAGE seconds"32}33return 134fi35/bin/rm -f "$lck"36echo "$$" > "$lck"37return 038}394041lock_file build.lck || {42exit 143}444546#ulimit -m 50000047#ulimit -s 50000048#ulimit -t 180049#ulimit -v 5000005051(52date5354oldhash=$(cd APM && git rev-parse HEAD)5556echo "Updating APM"57pushd APM58git checkout -f master59git fetch origin60git reset --hard origin/master61Tools/gittools/submodule-sync.sh62git clean -f -f -x -d -d63git tag autotest-$(date '+%Y-%m-%d-%H%M%S') -m "test tag `date`"64popd6566rsync -a APM/Tools/autotest/web-firmware/ buildlogs/binaries/6768echo "Updating MAVProxy"69pushd MAVProxy70git fetch origin71git reset --hard origin/master72git show73python3 -m pip install --user .74popd7576echo "Updating pymavlink"77pushd APM/modules/mavlink/pymavlink78git show79python3 -m pip install --user .80popd8182githash=$(cd APM && git rev-parse HEAD)83hdate=$(date +"%Y-%m-%d-%H:%m")8485(cd APM && Tools/scripts/build_parameters.sh)8687(cd APM && Tools/scripts/build_log_message_documentation.sh)8889(cd APM && Tools/scripts/build_docs.sh)9091killall -9 JSBSim || /bin/true9293# raise core limit94ulimit -c 100000009596# build in home dir, as on faster storage97export BUILD_BINARIES_PATH=$HOME/build/tmp9899# exit on panic so we don't waste time waiting around100export SITL_PANIC_EXIT=1101102timelimit 144000 python3 APM/Tools/autotest/autotest.py --autotest-server --timeout=143000 > buildlogs/autotest-output.txt 2>&1103104mkdir -p "buildlogs/history/$hdate"105106(cd buildlogs && cp -f *.txt *.flashlog *.tlog *.km[lz] *.gpx *.html *.png *.bin *.BIN *.elf "history/$hdate/")107echo $githash > "buildlogs/history/$hdate/githash.txt"108109) >> build.log 2>&1110111# autotest done, let's mark GTD flags112touch /tmp/.autotest.done113114115116