docker_run respect PX4_DOCKER_REPO env variable

This commit is contained in:
Daniel Agar
2017-07-18 21:51:10 -04:00
parent aa9023b72e
commit b9c1d87876
+25 -20
View File
@@ -1,28 +1,33 @@
#! /bin/bash #! /bin/bash
if [[ $@ =~ .*px4fmu.* ]]; then if [ -z ${PX4_DOCKER_REPO+x} ]; then
# nuttx-px4fmu-v{1,2,3,4,5} echo "guessing PX4_DOCKER_REPO based on input";
PX4_DOCKER_REPO="px4io/px4-dev-nuttx:2017-07-27" if [[ $@ =~ .*px4fmu.* ]]; then
elif [[ $@ =~ .*rpi.* ]] || [[ $@ =~ .*bebop.* ]]; then # nuttx-px4fmu-v{1,2,3,4,5}
# posix_rpi_cross, posix_bebop_default PX4_DOCKER_REPO="px4io/px4-dev-nuttx:2017-07-27"
PX4_DOCKER_REPO="px4io/px4-dev-raspi:2017-07-27" elif [[ $@ =~ .*rpi.* ]] || [[ $@ =~ .*bebop.* ]]; then
elif [[ $@ =~ .*eagle.* ]] || [[ $@ =~ .*excelsior.* ]]; then # posix_rpi_cross, posix_bebop_default
# eagle, excelsior PX4_DOCKER_REPO="px4io/px4-dev-raspi:2017-07-27"
PX4_DOCKER_REPO="lorenzmeier/px4-dev-snapdragon:2017-07-28" elif [[ $@ =~ .*eagle.* ]] || [[ $@ =~ .*excelsior.* ]]; then
elif [[ $@ =~ .*clang.* ]] || [[ $@ =~ .*scan-build.* ]]; then # eagle, excelsior
# clang tools PX4_DOCKER_REPO="lorenzmeier/px4-dev-snapdragon:2017-07-28"
PX4_DOCKER_REPO="px4io/px4-dev-clang:2017-07-27" elif [[ $@ =~ .*clang.* ]] || [[ $@ =~ .*scan-build.* ]]; then
elif [[ $@ =~ .*cppcheck.* ]]; then # clang tools
# need Ubuntu 17.04 for cppcheck cmake support PX4_DOCKER_REPO="px4io/px4-dev-clang:2017-07-27"
# TODO: remove this once px4io/px4-dev-base updates elif [[ $@ =~ .*cppcheck.* ]]; then
PX4_DOCKER_REPO=px4io/px4-dev-base:ubuntu17.04 # need Ubuntu 17.04 for cppcheck cmake support
elif [[ $@ =~ .*tests* ]]; then # TODO: remove this once px4io/px4-dev-base updates
# run all tests with simulation PX4_DOCKER_REPO=px4io/px4-dev-base:ubuntu17.04
PX4_DOCKER_REPO="px4io/px4-dev-simulation:2017-07-27" elif [[ $@ =~ .*tests* ]]; then
# run all tests with simulation
PX4_DOCKER_REPO="px4io/px4-dev-simulation:2017-07-27"
fi
else
echo "PX4_DOCKER_REPO is set to '$PX4_DOCKER_REPO'";
fi fi
# otherwise default to nuttx # otherwise default to nuttx
if [ -z "$PX4_DOCKER_REPO" ]; then if [ -z ${PX4_DOCKER_REPO+x} ]; then
PX4_DOCKER_REPO="px4io/px4-dev-nuttx:2017-07-27" PX4_DOCKER_REPO="px4io/px4-dev-nuttx:2017-07-27"
fi fi