Skip to content

Commit

Permalink
Make it possible to run dplsh non-interactive
Browse files Browse the repository at this point in the history
  • Loading branch information
danquah committed May 25, 2021
1 parent 2aaf802 commit 881daf3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions tools/dplsh/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tasks:
test:
env:
DPLSH_IMAGE: "{{.image}}"
DPLSH_NON_INTERACTIVE: "true"
cmds:
- ./dplsh.sh terraform -version
- ./dplsh.sh helm version
7 changes: 6 additions & 1 deletion tools/dplsh/dplsh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,15 @@ for key in "${!docker_creds[@]}"; do
ADDITIONAL_ARGS+=(-e "${key}=${docker_creds[$key]}")
done

# We run in interactive mode unless if we're in DPLSH_NON_INTERACTIVE.
if [[ -z "${DPLSH_NON_INTERACTIVE:-}" ]]; then
ADDITIONAL_ARGS+=(-i)
fi

docker run --hostname=dplsh \
--rm \
"${ADDITIONAL_ARGS[@]}" \
-ti \
-t \
-v "${HOME}/.azure:/home/dplsh/.azure-host" \
-v "${SHELL_ROOT}:/home/dplsh/host_mount" \
-w "/home/dplsh/host_mount/${CHDIR}" \
Expand Down

0 comments on commit 881daf3

Please sign in to comment.