Add --nopull argument
This commit is contained in:
@ -1,22 +1,30 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $0 [docker image name] [command]"
|
echo "Usage: $0 [--nopull] [docker image name] [command]"
|
||||||
echo
|
echo
|
||||||
echo Runs command in the specified docker image with
|
echo Runs command in the specified docker image with
|
||||||
echo a CI-appropriate environment
|
echo a CI-appropriate environment.
|
||||||
|
echo
|
||||||
|
echo "--nopull Skip the dockerhub image update"
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
NOPULL=false
|
||||||
|
if [[ $1 = --nopull ]]; then
|
||||||
|
NOPULL=true
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
IMAGE="$1"
|
IMAGE="$1"
|
||||||
if [[ -z "$IMAGE" ]]; then
|
if [[ -z "$IMAGE" ]]; then
|
||||||
echo Error: image not defined
|
echo Error: image not defined
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker pull "$IMAGE"
|
$NOPULL || docker pull "$IMAGE"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
ARGS=(
|
ARGS=(
|
||||||
|
Reference in New Issue
Block a user