pegleg/tools/pegleg.sh
Kaspars Skels 87b385be60 Enable override of terminal options for pegleg.sh
This takes care of removing -t option when running the script
with automated system (e.g. Jenkins)

Change-Id: I087b32d2635251f967a8f78c4d1f945827573be6
2018-09-22 11:16:06 -05:00

25 lines
571 B
Bash
Executable File

#!/usr/bin/env bash
set -e
: ${WORKSPACE:=$(pwd)}
: ${IMAGE:=quay.io/airshipit/pegleg:latest}
: ${TERM_OPTS:=-it}
echo
echo "== NOTE: Workspace $WORKSPACE is the execution directory in the container =="
echo
# Working directory inside container to execute commands from and mount from
# host OS
container_workspace_path='/workspace'
docker run --rm $TERM_OPTS \
--net=host \
--workdir="$container_workspace_path" \
-v "${HOME}/.ssh:${container_workspace_path}/.ssh" \
-v "${WORKSPACE}:$container_workspace_path" \
"${IMAGE}" \
pegleg "${@}"