Avoid ascking for a tty in Jenkins Pipeline

This commit is contained in:
R. Tyler Croy 2017-09-03 15:14:41 -07:00
parent a35fc3530f
commit 4c286eadf9
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
1 changed files with 8 additions and 1 deletions

View File

@ -1,6 +1,13 @@
#!/bin/sh
exec docker run --rm -ti \
# If we're executing from a normal shell, allow input. If we're in a
# subprocess, like under Jenkins Pipeline, don't allow it
tty --quiet
if [ $? -eq 0 ]; then
TTY_ARGS="-ti"
fi;
exec docker run --rm ${TTY_ARGS} \
-u $(id -u):$(id -g) \
-w ${PWD} \
-v ${PWD}:${PWD} \