Skip to content

Commit

Permalink
Added a way to not use the -it mode for docker easily by setting the …
Browse files Browse the repository at this point in the history
…CM env variable on run hyperledger#13

Signed-off-by: Stephen Curran <[email protected]>
  • Loading branch information
swcurran committed Aug 24, 2020
1 parent 0f64596 commit 2bf23a1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions fetch-validator-status/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set -x

export MSYS_NO_PATHCONV=1

# Running on Windows?
Expand All @@ -7,9 +9,17 @@ if [[ "$OSTYPE" == "msys" ]]; then
terminalEmu="winpty"
fi

# CM is for "cron mode" so Docker is run the right way for cron
# Use "CM=1 run.sh <args>..." to run from a fron job to run Docker in non-interactive mode
if [ -z "${CM+x}" ]; then
export DOCKER_INTERACTIVE="-it"
else
export DOCKER_INTERACTIVE=""
fi

docker build -t fetch_status . > /dev/null 2>&1
${terminalEmu} docker run --rm -ti \
${terminalEmu} docker run --rm ${DOCKER_INTERACTIVE} \
-e "GENESIS_PATH=${GENESIS_PATH}" \
-e "GENESIS_URL=${GENESIS_URL}" \
-e "SEED=${SEED}" \
fetch_status "$@"
fetch_status "$@"

0 comments on commit 2bf23a1

Please sign in to comment.