Avoid using a tty in the packer script unless it exists

This commit is contained in:
R. Tyler Croy 2017-08-25 23:46:53 -07:00
parent 4fe5c13fba
commit 3588d52f70
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
1 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,12 @@
#!/bin/sh
exec docker run --rm -ti \
tty --quiet
if [ $? -eq 0 ]; then
TTY_ARGS="-ti"
fi;
exec docker run --rm ${TTY_ARGS} \
-v $PWD:$PWD \
-w $PWD \
hashicorp/packer:light $@