|
| 1 | +#!/usr/bin/env cram |
| 2 | + |
| 3 | +Setup. |
| 4 | + |
| 5 | + $ : "${IMAGE:=localhost:5000/nextstrain/base:latest}" |
| 6 | + $ (docker image inspect "$IMAGE" || docker image pull "$IMAGE") &>/dev/null |
| 7 | + |
| 8 | +A workdir URL is required and not setting one here causes the entrypoint to |
| 9 | +error, but that's enough for testing verbose mode. |
| 10 | + |
| 11 | + $ export NEXTSTRAIN_AWS_BATCH_WORKDIR_URL= |
| 12 | + |
| 13 | +Verbose mode is default. |
| 14 | + |
| 15 | + $ docker run --rm --env=NEXTSTRAIN_AWS_BATCH_WORKDIR_URL "$IMAGE" \ |
| 16 | + > /sbin/entrypoint-aws-batch true |
| 17 | + + case "$NEXTSTRAIN_AWS_BATCH_WORKDIR_URL" in |
| 18 | + + echo 'entrypoint-aws-batch: No handler for NEXTSTRAIN_AWS_BATCH_WORKDIR_URL <>' |
| 19 | + entrypoint-aws-batch: No handler for NEXTSTRAIN_AWS_BATCH_WORKDIR_URL <> |
| 20 | + + exit 1 |
| 21 | + [1] |
| 22 | + |
| 23 | +Verbose mode is anything not zero. |
| 24 | + |
| 25 | + $ docker run --rm --env=NEXTSTRAIN_AWS_BATCH_{WORKDIR_URL,VERBOSE=yes} "$IMAGE" \ |
| 26 | + > /sbin/entrypoint-aws-batch true |
| 27 | + + case "$NEXTSTRAIN_AWS_BATCH_WORKDIR_URL" in |
| 28 | + + echo 'entrypoint-aws-batch: No handler for NEXTSTRAIN_AWS_BATCH_WORKDIR_URL <>' |
| 29 | + entrypoint-aws-batch: No handler for NEXTSTRAIN_AWS_BATCH_WORKDIR_URL <> |
| 30 | + + exit 1 |
| 31 | + [1] |
| 32 | + |
| 33 | + $ docker run --rm --env=NEXTSTRAIN_AWS_BATCH_{WORKDIR_URL,VERBOSE=} "$IMAGE" \ |
| 34 | + > /sbin/entrypoint-aws-batch true |
| 35 | + + case "$NEXTSTRAIN_AWS_BATCH_WORKDIR_URL" in |
| 36 | + + echo 'entrypoint-aws-batch: No handler for NEXTSTRAIN_AWS_BATCH_WORKDIR_URL <>' |
| 37 | + entrypoint-aws-batch: No handler for NEXTSTRAIN_AWS_BATCH_WORKDIR_URL <> |
| 38 | + + exit 1 |
| 39 | + [1] |
| 40 | + |
| 41 | +Verbose mode can be turned off. |
| 42 | + |
| 43 | + $ docker run --rm --env=NEXTSTRAIN_AWS_BATCH_{WORKDIR_URL,VERBOSE=0} "$IMAGE" \ |
| 44 | + > /sbin/entrypoint-aws-batch true |
| 45 | + entrypoint-aws-batch: No handler for NEXTSTRAIN_AWS_BATCH_WORKDIR_URL <> |
| 46 | + [1] |
0 commit comments