Simplify pegleg.sh usage
Remove unused code. Set WORKSPACE default to $PWD and set workdir in the container, so that users of pegleg.sh do not need to have any knowledge of the internal "/worksapce" mountpath inside the container, and in general simplify the execution of container command line tools. Change-Id: I56dea7d116f88df303aaeca8dc25a7b24cb291a6
This commit is contained in:
parent
1982ec8815
commit
83300a3da3
|
@ -2,24 +2,20 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
realpath() {
|
: ${WORKSPACE:=$(pwd)}
|
||||||
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
|
: ${IMAGE:=artifacts-aic.atlantafoundry.com/att-comdev/pegleg:latest}
|
||||||
}
|
|
||||||
|
|
||||||
SCRIPT_DIR=$(realpath "$(dirname "${0}")")
|
|
||||||
SOURCE_DIR=${SCRIPT_DIR}/pegleg
|
|
||||||
if [ -z "${WORKSPACE}" ]; then
|
|
||||||
WORKSPACE="/"
|
|
||||||
fi
|
|
||||||
|
|
||||||
IMAGE=${IMAGE:-artifacts-aic.atlantafoundry.com/att-comdev/pegleg:latest}
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "== NOTE: Workspace $WORKSPACE is available as /workspace in container context =="
|
echo "== NOTE: Workspace $WORKSPACE is the execution directory in the container =="
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
# Working directory inside container to execute commands from and mount from
|
||||||
|
# host OS
|
||||||
|
container_workspace_path='/workspace'
|
||||||
|
|
||||||
docker run --rm -t \
|
docker run --rm -t \
|
||||||
--net=none \
|
--net=none \
|
||||||
-v "${WORKSPACE}:/workspace" \
|
--workdir="$container_workspace_path" \
|
||||||
|
-v "${WORKSPACE}:$container_workspace_path" \
|
||||||
"${IMAGE}" \
|
"${IMAGE}" \
|
||||||
pegleg "${@}"
|
pegleg "${@}"
|
||||||
|
|
Loading…
Reference in New Issue