Skip to content

Commit edf06bf

Browse files
committed
use DEX_DEBUG to toggle runtime output
1 parent cfd08a8 commit edf06bf

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib.d/v1-runtime.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ v1-runtime(){
169169
# deactivate docker-machine
170170
__deactivate_machine
171171

172-
${DEX_RUNTIME:-exec} docker run $__docker_flags \
172+
${DEX_DEBUG:=false} && __exec="echo"
173+
${__exec:-exec} docker run $__docker_flags \
173174
-e DEX_DOCKER_HOME=$DEX_DOCKER_HOME \
174175
-e DEX_DOCKER_WORKSPACE=$DEX_DOCKER_WORKSPACE \
175176
-e DEX_HOST_GID=$DEX_HOST_GID \

tests/bats/06-runtime.bats

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ teardown(){
6666
[[ $output == *"DEX_HOST_UID=$(id -un)"* ]]
6767
[[ $output == *"DEX_HOST_USER=$(id -un)"* ]]
6868

69-
[[ $output == *"DEX_IMAGE=debian"* ]]
69+
[[ $output == *"DEX_IMAGE=$DEX_NAMESPACE/debian:latest"* ]]
7070
[[ $output == *"DEX_IMAGE_NAME=debian"* ]]
7171
[[ $output == *"DEX_IMAGE_TAG=latest"* ]]
7272
}
@@ -222,7 +222,7 @@ teardown(){
222222
@test "runtime suppresses tty flags when container output is piped" {
223223
# imgtest/labels image ::
224224
# LABEL dockerland.dex.docker_flags="--tty -e TESTVAR=TEST"
225-
local out=$(DEX_RUNTIME=echo $DEX run imgtest/labels echo "foo" | sed 's/foo/bar/')
225+
local out=$(DEX_DEBUG=true $DEX run imgtest/labels echo "foo" | sed 's/foo/bar/')
226226
[[ "$out" == *"--tty=false"* ]]
227227

228228
local out=$($DEX run imgtest/labels echo "foo" | sed 's/foo/bar/')
@@ -232,7 +232,7 @@ teardown(){
232232
@test "runtime suppresses tty flags when container input is piped" {
233233
# imgtest/labels image ::
234234
# LABEL dockerland.dex.docker_flags="--tty -e TESTVAR=TEST"
235-
local out=$(echo "foo" | DEX_RUNTIME=echo $DEX run imgtest/labels sed 's/foo/bar/')
235+
local out=$(echo "foo" | DEX_DEBUG=true $DEX run imgtest/labels sed 's/foo/bar/')
236236
[[ "$out" == *"--tty=false"* ]]
237237

238238
local out=$(echo "foo" | $DEX run imgtest/labels sed 's/foo/bar/')

0 commit comments

Comments
 (0)