Skip to content

Commit

Permalink
Handle empty ROS_DISTRO or DOCKER_IMAGE
Browse files Browse the repository at this point in the history
  • Loading branch information
mathias-luedtke committed Feb 7, 2021
1 parent 6f13041 commit fb0d4e9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion industrial_ci/src/isolation/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,16 @@ function ici_forward_variable() {
#######################################
function ici_isolate() {
local file=${1}; shift
DOCKER_IMAGE=${DOCKER_IMAGE:-${OS_NAME:-ubuntu}:$OS_CODE_NAME} # scheme works for all supported OS images

if [ "${DOCKER_IMAGE-x}" = "" ]; then
ici_error "Empty string passed to DOCKER_IMAGE. Specify a valid docker image or unset the environment variable to use the default image."
fi

if [ -n "${OS_CODE_NAME-}" ]; then
DOCKER_IMAGE=${DOCKER_IMAGE:-${OS_NAME}:$OS_CODE_NAME} # scheme works for all supported OS images
elif [ -z "${DOCKER_IMAGE-}" ]; then
ici_error "Please set ROS_DISTRO, OS_CODE_NAME or DOCKER_IMAGE."
fi

if [ "$DOCKER_PULL" != false ]; then
ici_run "pull_docker_image" docker pull "$DOCKER_IMAGE"
Expand Down

0 comments on commit fb0d4e9

Please sign in to comment.