Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
Rewrite condition to exec ./zalenium.sh in entry.sh considering none …
Browse files Browse the repository at this point in the history
…sudo
  • Loading branch information
tstern authored and diemol committed Aug 24, 2019
1 parent f5f9427 commit 0cac3c4
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions scripts/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,21 @@ if [ "${__run_with_gosu}" == "true" ]; then
else
# We will need sudo to run docker alongside docker
# because we don't have the matching group and user id (*nix)
if [ "${USE_KUBERNETES}" == "false" ]; then
if [ "${USE_KUBERNETES}" == "true" ]; then
# Removing the 'sudo' in Kubernetes
# Replace the current process with zalenium.sh
exec ./zalenium.sh "$@"
elif [ "${WE_HAVE_SUDO_ACCESS}" == "false" ]; then
# Make sure Docker works (without sudo) before continuing
docker --version
docker -H ${DOCKER_HOST} images elgalu/selenium >/dev/null
# Replace the current process with zalenium.sh
exec ./zalenium.sh "$@"
else
# Make sure Docker works (with sudo) before continuing
docker --version
sudo docker -H ${DOCKER_HOST} images elgalu/selenium >/dev/null
# Replace the current process with zalenium.sh
exec sudo --preserve-env ./zalenium.sh "$@"
else
# Removing the 'sudo' in Kubernetes
# Replace the current process with zalenium.sh
exec ./zalenium.sh "$@"
fi
fi

0 comments on commit 0cac3c4

Please # to comment.