cosmetic: move usage()
This commit is contained in:
1 parent
40cd875763
commit
74f77a71ce
1 file changed
+14
-14
@@ -12,6 +12,18 @@ fi
|
|||||||
|
|
||||||
IMAGE_VERSION=${VERSION:-$IMAGE_VERSION}
|
IMAGE_VERSION=${VERSION:-$IMAGE_VERSION}
|
||||||
|
|
||||||
|
# These are potentially used for remote execs, and have defaults, so
|
||||||
|
# we introduce them here
|
||||||
|
DOCKER_BRIDGE=${DOCKER_BRIDGE:-docker0}
|
||||||
|
PROCFS=${PROCFS:-/proc}
|
||||||
|
|
||||||
|
BASE_IMAGE=$DOCKERHUB_USER/weave
|
||||||
|
BASE_DNS_IMAGE=$DOCKERHUB_USER/weavedns
|
||||||
|
BASE_EXEC_IMAGE=$DOCKERHUB_USER/weaveexec
|
||||||
|
IMAGE=$BASE_IMAGE:$IMAGE_VERSION
|
||||||
|
DNS_IMAGE=$BASE_DNS_IMAGE:$IMAGE_VERSION
|
||||||
|
EXEC_IMAGE=$BASE_EXEC_IMAGE:$IMAGE_VERSION
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage:"
|
echo "Usage:"
|
||||||
echo "weave setup"
|
echo "weave setup"
|
||||||
@@ -37,20 +49,6 @@ usage() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $# -gt 0 ] || usage
|
|
||||||
|
|
||||||
# These are potentially used for remote execs, and have defaults, so
|
|
||||||
# we introduce them here
|
|
||||||
DOCKER_BRIDGE=${DOCKER_BRIDGE:-docker0}
|
|
||||||
PROCFS=${PROCFS:-/proc}
|
|
||||||
|
|
||||||
BASE_IMAGE=$DOCKERHUB_USER/weave
|
|
||||||
BASE_DNS_IMAGE=$DOCKERHUB_USER/weavedns
|
|
||||||
BASE_EXEC_IMAGE=$DOCKERHUB_USER/weaveexec
|
|
||||||
IMAGE=$BASE_IMAGE:$IMAGE_VERSION
|
|
||||||
DNS_IMAGE=$BASE_DNS_IMAGE:$IMAGE_VERSION
|
|
||||||
EXEC_IMAGE=$BASE_EXEC_IMAGE:$IMAGE_VERSION
|
|
||||||
|
|
||||||
exec_remote() {
|
exec_remote() {
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
@@ -66,6 +64,8 @@ exec_remote() {
|
|||||||
$EXEC_IMAGE --local "$@"
|
$EXEC_IMAGE --local "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ $# -gt 0 ] || usage
|
||||||
|
|
||||||
# "run" is a special case because we want to use docker directly,
|
# "run" is a special case because we want to use docker directly,
|
||||||
# rather than the docker in $EXEC_IMAGE remotely. That's because we
|
# rather than the docker in $EXEC_IMAGE remotely. That's because we
|
||||||
# are passing arbitrary arguments on to docker run, and we can't rely
|
# are passing arbitrary arguments on to docker run, and we can't rely
|
||||||
|
|||||||
Reference in new issue
Block a user